Commit a75c5a55ef289c0f255a629c8799f96ce3d9ecec
Merge remote-tracking branch 'origin/develop' into develop
# Conflicts: # .idea/compiler.xml # .idea/workspace.xml
Showing
32 changed files
with
531 additions
and
199 deletions
src/main/java/com/huaheng/pc/config/containerCapacity/controller/ContainerCapacityController.java
0 → 100644
1 | +package com.huaheng.pc.config.containerCapacity.controller; | |
2 | + | |
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
5 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
6 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
7 | +import com.huaheng.common.support.Convert; | |
8 | +import com.huaheng.common.utils.StringUtils; | |
9 | +import com.huaheng.common.utils.security.ShiroUtils; | |
10 | +import com.huaheng.framework.aspectj.lang.annotation.Log; | |
11 | +import com.huaheng.framework.aspectj.lang.constant.BusinessType; | |
12 | +import com.huaheng.framework.web.controller.BaseController; | |
13 | +import com.huaheng.framework.web.domain.AjaxResult; | |
14 | +import com.huaheng.framework.web.page.PageDomain; | |
15 | +import com.huaheng.framework.web.page.TableDataInfo; | |
16 | +import com.huaheng.framework.web.page.TableSupport; | |
17 | +import com.huaheng.pc.config.containerCapacity.domain.ContainerCapacity; | |
18 | +import com.huaheng.pc.config.containerCapacity.service.ContainerCapacityService; | |
19 | +import com.huaheng.pc.general.material.domain.Material; | |
20 | +import com.huaheng.pc.general.material.service.MaterialService; | |
21 | +import org.apache.shiro.authz.annotation.RequiresPermissions; | |
22 | +import org.springframework.beans.factory.annotation.Autowired; | |
23 | +import org.springframework.stereotype.Controller; | |
24 | +import org.springframework.ui.ModelMap; | |
25 | +import org.springframework.web.bind.annotation.*; | |
26 | + | |
27 | +import java.util.List; | |
28 | + | |
29 | +/** | |
30 | + * 容器容量值 | |
31 | + * 信息操作处理 | |
32 | + * | |
33 | + * @author ricard | |
34 | + * @date 2019-08-12 | |
35 | + */ | |
36 | +@Controller | |
37 | +@RequestMapping("/config/containerCapacity") | |
38 | +public class ContainerCapacityController extends BaseController { | |
39 | + | |
40 | + private String prefix = "config/containerCapacity"; | |
41 | + | |
42 | + @Autowired | |
43 | + private ContainerCapacityService containerCapacityService; | |
44 | + | |
45 | + @Autowired | |
46 | + private MaterialService materialService; | |
47 | + | |
48 | + @RequiresPermissions("config:containerCapacity:view") | |
49 | + @GetMapping() | |
50 | + public String containerCapacity() | |
51 | + { | |
52 | + return prefix + "/containerCapacity"; | |
53 | + } | |
54 | + | |
55 | + /** | |
56 | + * 查询容器容量列表 | |
57 | + */ | |
58 | + @RequiresPermissions("config:containerCapacity:list") | |
59 | + @Log(title = "配置-容器容量设置", operating = "查看容器容量", action = BusinessType.GRANT) | |
60 | + @PostMapping("/list") | |
61 | + @ResponseBody | |
62 | + public TableDataInfo list(ContainerCapacity containerCapacity,String createdBegin, String createdEnd) | |
63 | + { | |
64 | + LambdaQueryWrapper<ContainerCapacity> lambdaQueryWrapper = Wrappers.lambdaQuery(); | |
65 | + PageDomain pageDomain = TableSupport.buildPageRequest(); | |
66 | + Integer pageNum = pageDomain.getPageNum(); | |
67 | + Integer pageSize = pageDomain.getPageSize(); | |
68 | + | |
69 | + lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin),ContainerCapacity::getCreated, createdBegin) | |
70 | + .le(StringUtils.isNotEmpty(createdEnd), ContainerCapacity::getCreated, createdEnd) | |
71 | + .eq(ContainerCapacity::getWarehouseCode,ShiroUtils.getWarehouseCode()) | |
72 | + .eq(StringUtils.isNotEmpty(containerCapacity.getMaterialCode()),ContainerCapacity::getMaterialCode,containerCapacity.getMaterialCode()) | |
73 | + .eq(StringUtils.isNotEmpty(containerCapacity.getContainerType()), ContainerCapacity::getContainerType, containerCapacity.getContainerType()) | |
74 | + .like(StringUtils.isNotEmpty(containerCapacity.getMaterialName()), ContainerCapacity::getMaterialName, containerCapacity.getMaterialName()) | |
75 | + .orderByAsc(ContainerCapacity::getId); | |
76 | + | |
77 | + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){ | |
78 | + /** | |
79 | + * 使用分页查询 | |
80 | + */ | |
81 | + Page<ContainerCapacity> page = new Page<>(pageNum, pageSize); | |
82 | + IPage<ContainerCapacity> iPage = containerCapacityService.page(page, lambdaQueryWrapper); | |
83 | + return getMpDataTable(iPage.getRecords(),iPage.getTotal()); | |
84 | + } else { | |
85 | + List<ContainerCapacity> list = containerCapacityService.list(lambdaQueryWrapper); | |
86 | + return getDataTable(list); | |
87 | + } | |
88 | + } | |
89 | + | |
90 | + | |
91 | + /** | |
92 | + * 新增容器容量数据 | |
93 | + */ | |
94 | + @GetMapping("/add") | |
95 | + public String add() | |
96 | + { | |
97 | + return prefix + "/add"; | |
98 | + } | |
99 | + | |
100 | + /** | |
101 | + * 新增保存容器容量数据 | |
102 | + */ | |
103 | + @RequiresPermissions("config:containerCapacity:add") | |
104 | + @Log(title = "配置-容器容量设置", operating = "新增容器容量", action = BusinessType.INSERT) | |
105 | + @PostMapping("/add") | |
106 | + @ResponseBody | |
107 | + public AjaxResult addSave(ContainerCapacity containerCapacity) | |
108 | + { | |
109 | + AjaxResult ajaxResult=containerCapacityService.insertModel(containerCapacity); | |
110 | + return ajaxResult; | |
111 | + } | |
112 | + | |
113 | + /** | |
114 | + * 修改容器容量 | |
115 | + */ | |
116 | + @GetMapping("/edit/{id}") | |
117 | + public String edit(@PathVariable("id") Integer id, ModelMap mmap) | |
118 | + { | |
119 | + ContainerCapacity containerCapacity = containerCapacityService.getById(id); | |
120 | + mmap.put("containerCapacity", containerCapacity); | |
121 | + return prefix + "/edit"; | |
122 | + } | |
123 | + | |
124 | + /** | |
125 | + * 修改保存容器容量 | |
126 | + */ | |
127 | + @RequiresPermissions("config:containerCapacity:edit") | |
128 | + @Log(title = "配置-容器容量设置", operating = "修改容器容量", action = BusinessType.UPDATE) | |
129 | + @PostMapping("/edit") | |
130 | + @ResponseBody | |
131 | + public AjaxResult editSave(ContainerCapacity containerCapacity) | |
132 | + { | |
133 | + containerCapacity.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
134 | + return toAjax(containerCapacityService.saveOrUpdate(containerCapacity)); | |
135 | + } | |
136 | + | |
137 | + /** | |
138 | + * 删除容器类型 | |
139 | + */ | |
140 | + @RequiresPermissions("config:containerCapacity:remove") | |
141 | + @Log(title = "配置-容器容量设置", operating = "删除容器容量", action = BusinessType.DELETE) | |
142 | + @PostMapping( "/remove") | |
143 | + @ResponseBody | |
144 | + public AjaxResult remove(String ids) | |
145 | + { | |
146 | + if (StringUtils.isEmpty(ids)) | |
147 | + return AjaxResult.error("id不能为空"); | |
148 | + for (Integer id : Convert.toIntArray(ids)) | |
149 | + { | |
150 | + | |
151 | + } | |
152 | + return AjaxResult.success("删除成功!"); | |
153 | + } | |
154 | + | |
155 | + | |
156 | + | |
157 | +} | |
... | ... |
src/main/java/com/huaheng/pc/config/containerCapacity/domain/ContainerCapacity.java
src/main/java/com/huaheng/pc/config/containerCapacity/service/ContainerCapacityService.java
1 | 1 | package com.huaheng.pc.config.containerCapacity.service; |
2 | 2 | |
3 | +import com.huaheng.framework.web.domain.AjaxResult; | |
3 | 4 | import com.huaheng.pc.config.containerCapacity.domain.ContainerCapacity; |
4 | 5 | import com.baomidou.mybatisplus.extension.service.IService; |
5 | 6 | public interface ContainerCapacityService extends IService<ContainerCapacity>{ |
6 | 7 | |
7 | 8 | |
9 | + //新增容器容量 | |
10 | + AjaxResult insertModel(ContainerCapacity containerCapacity); | |
11 | + | |
8 | 12 | } |
... | ... |
src/main/java/com/huaheng/pc/config/containerCapacity/service/ContainerCapacityServiceImpl.java
1 | 1 | package com.huaheng.pc.config.containerCapacity.service; |
2 | 2 | |
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
4 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
5 | +import com.huaheng.common.utils.StringUtils; | |
6 | +import com.huaheng.common.utils.security.ShiroUtils; | |
7 | +import com.huaheng.framework.web.domain.AjaxResult; | |
8 | +import com.huaheng.pc.config.containerType.domain.ContainerType; | |
9 | +import com.huaheng.pc.config.containerType.service.ContainerTypeService; | |
10 | +import com.huaheng.pc.general.material.domain.Material; | |
11 | +import com.huaheng.pc.general.material.service.MaterialService; | |
12 | +import org.springframework.beans.factory.annotation.Autowired; | |
3 | 13 | import org.springframework.stereotype.Service; |
4 | 14 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
5 | 15 | import com.huaheng.pc.config.containerCapacity.mapper.ContainerCapacityMapper; |
... | ... | @@ -8,4 +18,42 @@ import com.huaheng.pc.config.containerCapacity.domain.ContainerCapacity; |
8 | 18 | @Service |
9 | 19 | public class ContainerCapacityServiceImpl extends ServiceImpl<ContainerCapacityMapper, ContainerCapacity> implements ContainerCapacityService{ |
10 | 20 | |
21 | + @Autowired | |
22 | + private MaterialService materialService; | |
23 | + @Autowired | |
24 | + private ContainerTypeService containerTypeService; | |
25 | + | |
26 | + | |
27 | + //判断容器类别是否存在,添加容器容量时,查找到该物料的具体信息,一并加入到容器容量中 | |
28 | + @Override | |
29 | + public AjaxResult insertModel(ContainerCapacity containerCapacity) { | |
30 | + containerCapacity.setWarehouseCode(ShiroUtils.getWarehouseCode()); | |
31 | + containerCapacity.setCreatedBy(ShiroUtils.getLoginName()); | |
32 | + containerCapacity.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
33 | + | |
34 | + //查找该容器类别信息 | |
35 | + LambdaQueryWrapper<ContainerType> lambdaQueryWrappers = Wrappers.lambdaQuery(); | |
36 | + lambdaQueryWrappers.eq(StringUtils.isNotEmpty(containerCapacity.getContainerType()),ContainerType::getCode, containerCapacity.getContainerType()) | |
37 | + .eq(StringUtils.isNotEmpty(containerCapacity.getWarehouseCode()),ContainerType::getWarehouseCode, containerCapacity.getWarehouseCode()); | |
38 | + ContainerType containerType=containerTypeService.getOne(lambdaQueryWrappers); | |
39 | + if(containerType==null){ | |
40 | + return AjaxResult.error("系统没有该容器类型"); | |
41 | + } | |
42 | + | |
43 | + //查找该物料信息 | |
44 | + LambdaQueryWrapper<Material> lambdaQueryWrapper = Wrappers.lambdaQuery(); | |
45 | + lambdaQueryWrapper.eq(StringUtils.isNotEmpty(containerCapacity.getMaterialCode()),Material::getCode, containerCapacity.getMaterialCode()) | |
46 | + .eq(StringUtils.isNotEmpty(containerCapacity.getWarehouseCode()),Material::getWarehouseCode, containerCapacity.getWarehouseCode()); | |
47 | + Material material=materialService.getOne(lambdaQueryWrapper); | |
48 | + if(material==null){ | |
49 | + return AjaxResult.error("系统没有该物料"); | |
50 | + } | |
51 | + containerCapacity.setMaterialName(material.getName()); | |
52 | + containerCapacity.setMaterialSpec(material.getSpec()); | |
53 | + containerCapacity.setMaterialUnit(material.getUnit()); | |
54 | + if(!this.save(containerCapacity)){ | |
55 | + return AjaxResult.error("新增容器容量失败"); | |
56 | + } | |
57 | + return AjaxResult.success("新增容器容量成功"); | |
58 | + } | |
11 | 59 | } |
... | ... |
src/main/java/com/huaheng/pc/config/containerType/controller/ContainerTypeController.java
src/main/java/com/huaheng/pc/config/locationType/controller/LocationTypeController.java
src/main/java/com/huaheng/pc/config/zone/controller/ZoneController.java
... | ... | @@ -24,6 +24,13 @@ import org.springframework.web.bind.annotation.*; |
24 | 24 | |
25 | 25 | import java.util.List; |
26 | 26 | |
27 | +/** | |
28 | + * 库区 信息操作处理 | |
29 | + * | |
30 | + * @author ricard | |
31 | + * @date 2019-08-12 | |
32 | + */ | |
33 | + | |
27 | 34 | @Controller |
28 | 35 | @RequestMapping("/config/zone") |
29 | 36 | public class ZoneController extends BaseController { |
... | ... |
src/main/java/com/huaheng/pc/config/zoneCapacity/controller/ZoneCapacityController.java
src/main/java/com/huaheng/pc/general/company/service/CompanyServiceImpl.java
src/main/java/com/huaheng/pc/general/warehouse/domain/Warehouse.java
... | ... | @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField; |
5 | 5 | import com.baomidou.mybatisplus.annotation.TableId; |
6 | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
7 | 7 | import lombok.Data; |
8 | +import org.springframework.transaction.annotation.Transactional; | |
8 | 9 | |
9 | 10 | import java.io.Serializable; |
10 | 11 | import java.util.Date; |
... | ... | @@ -84,6 +85,15 @@ public class Warehouse implements Serializable { |
84 | 85 | @TableField(value = "email") |
85 | 86 | private String email; |
86 | 87 | |
88 | + public boolean isFlag() { | |
89 | + return flag; | |
90 | + } | |
91 | + | |
92 | + public Warehouse setFlag(boolean flag) { | |
93 | + this.flag = flag; | |
94 | + return this; | |
95 | + } | |
96 | + | |
87 | 97 | /** |
88 | 98 | * 上位系统url地址 |
89 | 99 | */ |
... | ... | @@ -189,6 +199,10 @@ public class Warehouse implements Serializable { |
189 | 199 | @TableField(value = "deleted") |
190 | 200 | private Boolean deleted; |
191 | 201 | |
202 | + /** 用户是否存在此仓库标识 默认不存在 */ | |
203 | + @TableField(exist = false) | |
204 | + private boolean flag = false; | |
205 | + | |
192 | 206 | private static final long serialVersionUID = 1L; |
193 | 207 | |
194 | 208 | public static final String COL_ADDRESS1 = "address1"; |
... | ... |
src/main/java/com/huaheng/pc/general/warehouse/mapper/WarehouseMapper.java
... | ... | @@ -2,6 +2,16 @@ package com.huaheng.pc.general.warehouse.mapper; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | 4 | import com.huaheng.pc.general.warehouse.domain.Warehouse; |
5 | +import com.huaheng.pc.system.role.domain.Role; | |
6 | +import com.huaheng.pc.system.user.domain.SysUserWarehouse; | |
7 | + | |
8 | +import java.util.List; | |
5 | 9 | |
6 | 10 | public interface WarehouseMapper extends BaseMapper<Warehouse> { |
11 | + | |
12 | + public List<SysUserWarehouse> wareHouseAll(); | |
13 | + | |
14 | + public List<Warehouse> selectWarehouseByUserId(Integer userId); | |
15 | + | |
16 | + public List<Warehouse> selectWarehouseAll(); | |
7 | 17 | } |
8 | 18 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/general/warehouse/service/WarehouseService.java
... | ... | @@ -2,6 +2,7 @@ package com.huaheng.pc.general.warehouse.service; |
2 | 2 | |
3 | 3 | import com.huaheng.pc.general.warehouse.domain.Warehouse; |
4 | 4 | import com.baomidou.mybatisplus.extension.service.IService; |
5 | +import com.huaheng.pc.system.user.domain.SysUserWarehouse; | |
5 | 6 | |
6 | 7 | import java.util.List; |
7 | 8 | import java.util.Map; |
... | ... | @@ -9,4 +10,9 @@ import java.util.Map; |
9 | 10 | public interface WarehouseService extends IService<Warehouse>{ |
10 | 11 | |
11 | 12 | List<Map<String,Object>> getWarehouseList(Integer id); |
13 | + | |
14 | + public List<Warehouse> selectWarehouseByUserId(Integer userId); | |
15 | + | |
16 | + | |
17 | + | |
12 | 18 | } |
... | ... |
src/main/java/com/huaheng/pc/general/warehouse/service/WarehouseServiceImpl.java
... | ... | @@ -2,8 +2,11 @@ package com.huaheng.pc.general.warehouse.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | +import com.huaheng.common.utils.security.ShiroUtils; | |
5 | 6 | import com.huaheng.pc.general.warehouseCopany.domain.WarehouseCompany; |
6 | 7 | import com.huaheng.pc.general.warehouseCopany.service.WarehouseCompanyService; |
8 | +import com.huaheng.pc.system.role.domain.Role; | |
9 | +import com.huaheng.pc.system.user.domain.SysUserWarehouse; | |
7 | 10 | import org.springframework.stereotype.Service; |
8 | 11 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
9 | 12 | import com.huaheng.pc.general.warehouse.mapper.WarehouseMapper; |
... | ... | @@ -47,4 +50,24 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper, Warehouse |
47 | 50 | } |
48 | 51 | return warehouseList; |
49 | 52 | } |
53 | + | |
54 | + @Override | |
55 | + public List<Warehouse> selectWarehouseByUserId(Integer userId) | |
56 | + { | |
57 | + List<Warehouse> userWarhouses = warehouseMapper.selectWarehouseByUserId(userId); | |
58 | + List<Warehouse> warehouses = warehouseMapper.selectWarehouseAll(); | |
59 | + for (Warehouse warehouse : warehouses) | |
60 | + { | |
61 | + for (Warehouse userWarehouse: userWarhouses) | |
62 | + { | |
63 | + if (warehouse.getCode().equals(userWarehouse.getCode())) | |
64 | + { | |
65 | + warehouse.setFlag(true); | |
66 | + break; | |
67 | + } | |
68 | + } | |
69 | + } | |
70 | + return warehouses; | |
71 | + } | |
72 | + | |
50 | 73 | } |
... | ... |
src/main/java/com/huaheng/pc/system/user/controller/UserController.java
... | ... | @@ -2,11 +2,22 @@ package com.huaheng.pc.system.user.controller; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | +import com.huaheng.common.constant.Constants; | |
6 | +import com.huaheng.common.utils.MessageUtils; | |
7 | +import com.huaheng.common.utils.SystemLogUtils; | |
5 | 8 | import com.huaheng.common.utils.security.ShiroUtils; |
9 | +import com.huaheng.framework.shiro.web.filter.LogoutFilter; | |
6 | 10 | import com.huaheng.pc.general.company.domain.Company; |
7 | 11 | import com.huaheng.pc.general.company.service.CompanyService; |
12 | +import com.huaheng.pc.general.warehouse.domain.Warehouse; | |
13 | +import com.huaheng.pc.general.warehouse.mapper.WarehouseMapper; | |
14 | +import com.huaheng.pc.general.warehouse.service.WarehouseService; | |
15 | +import com.huaheng.pc.system.user.domain.SysUserWarehouse; | |
8 | 16 | import org.apache.shiro.authz.annotation.RequiresPermissions; |
17 | +import org.apache.shiro.session.SessionException; | |
18 | +import org.apache.shiro.subject.Subject; | |
9 | 19 | import org.springframework.beans.factory.annotation.Autowired; |
20 | +import org.springframework.boot.web.servlet.server.Session; | |
10 | 21 | import org.springframework.stereotype.Controller; |
11 | 22 | import org.springframework.transaction.annotation.Transactional; |
12 | 23 | import org.springframework.ui.ModelMap; |
... | ... | @@ -25,7 +36,14 @@ import com.huaheng.framework.web.page.TableDataInfo; |
25 | 36 | import com.huaheng.pc.system.role.service.IRoleService; |
26 | 37 | import com.huaheng.pc.system.user.domain.User; |
27 | 38 | import com.huaheng.pc.system.user.service.IUserService; |
39 | + | |
40 | +import javax.annotation.Resource; | |
41 | +import javax.servlet.ServletRequest; | |
42 | +import javax.servlet.ServletResponse; | |
28 | 43 | import java.util.List; |
44 | +import java.util.Map; | |
45 | + | |
46 | +import static javax.security.auth.Subject.getSubject; | |
29 | 47 | |
30 | 48 | /** |
31 | 49 | * 用户信息 |
... | ... | @@ -47,6 +65,12 @@ public class UserController extends BaseController |
47 | 65 | @Autowired |
48 | 66 | private CompanyService companyService; |
49 | 67 | |
68 | + @Autowired | |
69 | + private WarehouseService warehouseService; | |
70 | + | |
71 | + @Resource | |
72 | + private WarehouseMapper warehouseMapper; | |
73 | + | |
50 | 74 | @RequiresPermissions("system:user:view") |
51 | 75 | @GetMapping() |
52 | 76 | public String user() |
... | ... | @@ -94,6 +118,13 @@ public class UserController extends BaseController |
94 | 118 | mmap.put("roles", roleService.selectRoleAll()); |
95 | 119 | LambdaQueryWrapper<Company> lambdaQueryWrapper = Wrappers.lambdaQuery(company); |
96 | 120 | mmap.put("companys", companyService.list(lambdaQueryWrapper)); |
121 | + LambdaQueryWrapper<Warehouse> warehouse = Wrappers.lambdaQuery(); | |
122 | + warehouse.select(Warehouse::getCode,Warehouse::getName,Warehouse::getEnable); | |
123 | + List<Map<String, Object>> warehouseList = warehouseService.listMaps(warehouse); | |
124 | + for (Map<String, Object> item : warehouseList){ | |
125 | + item.put("value",item.get("code").toString()); | |
126 | + } | |
127 | + mmap.put("warehouseList",warehouseList); | |
97 | 128 | return prefix + "/add"; |
98 | 129 | } |
99 | 130 | |
... | ... | @@ -124,6 +155,7 @@ public class UserController extends BaseController |
124 | 155 | mmap.put("user", userService.selectUserById(id)); |
125 | 156 | mmap.put("roles", roleService.selectRolesByUserId(id)); |
126 | 157 | mmap.put("companys", companyService.selectCompanyByUserId()); |
158 | + mmap.put("warehouses", warehouseService.selectWarehouseByUserId(id)); | |
127 | 159 | return prefix + "/edit"; |
128 | 160 | } |
129 | 161 | |
... | ... | @@ -137,11 +169,16 @@ public class UserController extends BaseController |
137 | 169 | @ResponseBody |
138 | 170 | public AjaxResult editSave(User user) |
139 | 171 | { |
172 | + | |
140 | 173 | if (StringUtils.isNotNull(user.getId()) && User.isAdmin(user.getId())) |
141 | 174 | { |
142 | 175 | return error("不允许修改超级管理员用户"); |
143 | 176 | } |
144 | 177 | AjaxResult ajaxResult = toAjax(userService.updateUser(user)); |
178 | + | |
179 | + if (ShiroUtils.getLoginName().equals(user.getUserName())) | |
180 | + ShiroUtils.logout(); | |
181 | + | |
145 | 182 | return ajaxResult; |
146 | 183 | } |
147 | 184 | |
... | ... |
src/main/java/com/huaheng/pc/system/userWarehouse/domain/SysUserWarehouse.java renamed to src/main/java/com/huaheng/pc/system/user/domain/SysUserWarehouse.java
1 | -package com.huaheng.pc.system.userWarehouse.domain; | |
1 | +package com.huaheng.pc.system.user.domain; | |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.annotation.IdType; |
4 | 4 | import com.baomidou.mybatisplus.annotation.TableField; |
... | ... | @@ -6,9 +6,10 @@ import com.baomidou.mybatisplus.annotation.TableId; |
6 | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
7 | 7 | import io.swagger.annotations.ApiModel; |
8 | 8 | import io.swagger.annotations.ApiModelProperty; |
9 | -import java.io.Serializable; | |
10 | 9 | import lombok.Data; |
11 | 10 | |
11 | +import java.io.Serializable; | |
12 | + | |
12 | 13 | @ApiModel(value="com.huaheng.pc.system.userWarehousel.domain.SysUserWarehouse") |
13 | 14 | @Data |
14 | 15 | @TableName(value = "sys_user_warehouse") |
... | ... |
src/main/java/com/huaheng/pc/system/user/domain/User.java
src/main/java/com/huaheng/pc/system/user/mapper/SysUserWarehouseMapper.java
0 → 100644
1 | +package com.huaheng.pc.system.user.mapper; | |
2 | + | |
3 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
4 | +import com.huaheng.pc.system.user.domain.SysUserWarehouse; | |
5 | +import org.apache.ibatis.annotations.Param; | |
6 | + | |
7 | +import java.util.List; | |
8 | + | |
9 | + | |
10 | +public interface SysUserWarehouseMapper extends BaseMapper<SysUserWarehouse> { | |
11 | + | |
12 | + public int batchUserWarehouse(@Param("userWarehouseList") List<SysUserWarehouse> userWarehouseList); | |
13 | + | |
14 | + public int deleteUserWarehouseByUserId(Integer userId); | |
15 | + | |
16 | +} | |
0 | 17 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/system/user/mapper/UserMapper.java
... | ... | @@ -132,6 +132,14 @@ public interface UserMapper |
132 | 132 | */ |
133 | 133 | public List<Map<String, Object>> getWarehouseByUserCode(@Param("loginName")String loginName); |
134 | 134 | |
135 | + | |
136 | + /** | |
137 | + * 根据用户编码查询该用户所有仓库 | |
138 | + * @param loginName | |
139 | + * @return | |
140 | + */ | |
141 | + public List<Map<String, Object>> getWarehouseByUserName(@Param("loginName")String loginName); | |
142 | + | |
135 | 143 | /** |
136 | 144 | * 更新用户维护日期 |
137 | 145 | * @param date |
... | ... |
src/main/java/com/huaheng/pc/system/user/service/IUserService.java
... | ... | @@ -2,8 +2,10 @@ package com.huaheng.pc.system.user.service; |
2 | 2 | |
3 | 3 | import com.huaheng.framework.web.domain.AjaxResult; |
4 | 4 | import com.huaheng.pc.system.user.domain.ClientType; |
5 | +import com.huaheng.pc.system.user.domain.SysUserWarehouse; | |
5 | 6 | import com.huaheng.pc.system.user.domain.User; |
6 | 7 | import io.swagger.models.auth.In; |
8 | +import org.apache.ibatis.annotations.Param; | |
7 | 9 | |
8 | 10 | import java.util.Date; |
9 | 11 | import java.util.List; |
... | ... | @@ -195,6 +197,8 @@ public interface IUserService |
195 | 197 | * @return |
196 | 198 | */ |
197 | 199 | public User selectmen(String loginName); |
200 | + | |
201 | + public int batchUserWarehouse(@Param("userWarehouseList") List<SysUserWarehouse> userWarehouseList); | |
198 | 202 | } |
199 | 203 | |
200 | 204 | |
... | ... |
src/main/java/com/huaheng/pc/system/user/service/UserServiceImpl.java
... | ... | @@ -13,8 +13,8 @@ import com.huaheng.pc.general.company.mapper.CompanyMapper; |
13 | 13 | import com.huaheng.pc.general.company.service.CompanyService; |
14 | 14 | import com.huaheng.pc.general.warehouse.service.WarehouseService; |
15 | 15 | import com.huaheng.pc.general.warehouse.domain.Warehouse; |
16 | -import com.huaheng.pc.system.user.domain.ClientType; | |
17 | -import com.huaheng.pc.system.user.domain.UserCompany; | |
16 | +import com.huaheng.pc.system.user.domain.*; | |
17 | +import com.huaheng.pc.system.user.mapper.SysUserWarehouseMapper; | |
18 | 18 | import com.huaheng.pc.system.user.mapper.UserCompanyMapper; |
19 | 19 | import org.apache.shiro.SecurityUtils; |
20 | 20 | import org.apache.shiro.authc.AuthenticationException; |
... | ... | @@ -29,8 +29,6 @@ import com.huaheng.common.utils.security.ShiroUtils; |
29 | 29 | import com.huaheng.framework.shiro.service.PasswordService; |
30 | 30 | import com.huaheng.pc.system.role.domain.Role; |
31 | 31 | import com.huaheng.pc.system.role.mapper.RoleMapper; |
32 | -import com.huaheng.pc.system.user.domain.User; | |
33 | -import com.huaheng.pc.system.user.domain.UserRole; | |
34 | 32 | import com.huaheng.pc.system.user.mapper.UserMapper; |
35 | 33 | import com.huaheng.pc.system.user.mapper.UserRoleMapper; |
36 | 34 | |
... | ... | @@ -68,11 +66,14 @@ public class UserServiceImpl implements IUserService |
68 | 66 | @Resource |
69 | 67 | private WarehouseService warehouseService; |
70 | 68 | |
69 | + @Resource | |
70 | + private SysUserWarehouseMapper sysUserWarehouseMapper; | |
71 | + | |
71 | 72 | /** |
72 | 73 | * 登陆验证 |
73 | 74 | * @param username 用户名 |
74 | 75 | * @param password 密 码 |
75 | - * @param warehouseId 仓库id | |
76 | +// * @param warehouseId 仓库id | |
76 | 77 | * @param warehouseCode 仓库编码 |
77 | 78 | * @return |
78 | 79 | */ |
... | ... | @@ -262,6 +263,8 @@ public class UserServiceImpl implements IUserService |
262 | 263 | insertUserCompany(user); |
263 | 264 | // 新增用户与角色管理 |
264 | 265 | insertUserRole(user); |
266 | + // 新增用户与仓库管理 | |
267 | + insertUserWarehouse(user); | |
265 | 268 | return rows; |
266 | 269 | } |
267 | 270 | |
... | ... | @@ -284,6 +287,11 @@ public class UserServiceImpl implements IUserService |
284 | 287 | userCompanyMapper.deleteUserCompanyByUserId(userId); |
285 | 288 | // 新增用户与货主管理 |
286 | 289 | insertUserCompany(user); |
290 | + // 删除用户与仓库关联 | |
291 | + sysUserWarehouseMapper.deleteUserWarehouseByUserId(userId); | |
292 | + // 新增用户与仓库管理 | |
293 | + insertUserWarehouse(user); | |
294 | + | |
287 | 295 | return userMapper.updateUser(user); |
288 | 296 | } |
289 | 297 | |
... | ... | @@ -335,6 +343,29 @@ public class UserServiceImpl implements IUserService |
335 | 343 | } |
336 | 344 | } |
337 | 345 | |
346 | + | |
347 | + /** | |
348 | + * 新增用户仓库信息 | |
349 | + * | |
350 | + * @param user 用户对象 | |
351 | + */ | |
352 | + public void insertUserWarehouse(User user) | |
353 | + { | |
354 | + // 新增用户与仓库管理 | |
355 | + List<SysUserWarehouse> list = new ArrayList<SysUserWarehouse>(); | |
356 | + if (user.getWarehouseCodeList() != null) { | |
357 | + for (String warehouseCode : user.getWarehouseCodeList()) { | |
358 | + SysUserWarehouse warehouse = new SysUserWarehouse(); | |
359 | + warehouse.setUserId(user.getId()); | |
360 | + warehouse.setWarehouseCode(warehouseCode); | |
361 | + list.add(warehouse); | |
362 | + } | |
363 | + if (list.size() > 0) { | |
364 | + sysUserWarehouseMapper.batchUserWarehouse(list); | |
365 | + } | |
366 | + } | |
367 | + } | |
368 | + | |
338 | 369 | /** |
339 | 370 | * 新增用户货主信息 |
340 | 371 | * |
... | ... | @@ -469,7 +500,11 @@ public class UserServiceImpl implements IUserService |
469 | 500 | } |
470 | 501 | else |
471 | 502 | { |
472 | - list = userMapper.getWarehouseByUserCode(loginName); | |
503 | + list = userMapper.getWarehouseByUserName(loginName); | |
504 | + if (list.size()==1) | |
505 | + list=userMapper.getWarehouseByUserCode(loginName); | |
506 | + | |
507 | + | |
473 | 508 | } |
474 | 509 | return list; |
475 | 510 | } |
... | ... | @@ -552,4 +587,9 @@ public class UserServiceImpl implements IUserService |
552 | 587 | return user; |
553 | 588 | } |
554 | 589 | |
590 | + @Override | |
591 | + public int batchUserWarehouse(List<SysUserWarehouse> userWarehouseList) { | |
592 | + return sysUserWarehouseMapper.batchUserWarehouse(userWarehouseList); | |
593 | + } | |
594 | + | |
555 | 595 | } |
... | ... |
src/main/java/com/huaheng/pc/system/userWarehouse/mapper/SysUserWarehouseMapper.java deleted
1 | -package com.huaheng.pc.system.userWarehouse.mapper; | |
2 | - | |
3 | -import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
4 | -import com.huaheng.pc.system.userWarehouse.domain.SysUserWarehouse; | |
5 | - | |
6 | -public interface SysUserWarehouseMapper extends BaseMapper<SysUserWarehouse> { | |
7 | -} | |
8 | 0 | \ No newline at end of file |
src/main/java/com/huaheng/pc/system/userWarehouse/service/SysUserWarehouseService.java deleted
src/main/java/com/huaheng/pc/system/userWarehouse/service/SysUserWarehouseServiceImpl.java deleted
1 | -package com.huaheng.pc.system.userWarehouse.service; | |
2 | - | |
3 | -import org.springframework.stereotype.Service; | |
4 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
5 | -import com.huaheng.pc.system.userWarehouse.mapper.SysUserWarehouseMapper; | |
6 | -import com.huaheng.pc.system.userWarehouse.domain.SysUserWarehouse; | |
7 | - | |
8 | -@Service | |
9 | -public class SysUserWarehouseServiceImpl extends ServiceImpl<SysUserWarehouseMapper, SysUserWarehouse> implements SysUserWarehouseService{ | |
10 | - | |
11 | -} |
src/main/resources/mybatis/general/WarehouseMapper.xml
... | ... | @@ -34,6 +34,26 @@ |
34 | 34 | <result column="userDef8" jdbcType="VARCHAR" property="userDef8" /> |
35 | 35 | <result column="deleted" jdbcType="BIT" property="deleted" /> |
36 | 36 | </resultMap> |
37 | + <select id="wareHouseAll" resultType="com.huaheng.pc.system.user.domain.SysUserWarehouse"> | |
38 | + select * from warehouse | |
39 | + </select> | |
40 | + | |
41 | + <select id="selectWarehouseByUserId" | |
42 | + resultType="com.huaheng.pc.general.warehouse.domain.Warehouse"> | |
43 | + SELECT r.`name`, r.code | |
44 | + FROM sys_user u | |
45 | + LEFT JOIN sys_user_warehouse ur ON u.id = ur.userId | |
46 | + LEFT JOIN warehouse r ON ur.warehouseCode = r.code | |
47 | + WHERE ur.userId =#{userId} | |
48 | + </select> | |
49 | + | |
50 | + <select id="selectWarehouseAll" | |
51 | + resultType="com.huaheng.pc.general.warehouse.domain.Warehouse"> | |
52 | + select * from warehouse | |
53 | + </select> | |
54 | + | |
55 | + | |
56 | + | |
37 | 57 | <sql id="Base_Column_List"> |
38 | 58 | <!--@mbg.generated--> |
39 | 59 | code, address1, address2, city, `state`, district, country, postalCode, attentionTo, |
... | ... |
src/main/resources/mybatis/system/SysUserWarehouseMapper.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="com.huaheng.pc.system.user.mapper.SysUserWarehouseMapper"> | |
4 | + <resultMap id="BaseResultMap" type="com.huaheng.pc.system.user.domain.SysUserWarehouse"> | |
5 | + <!--@mbg.generated--> | |
6 | + <id column="id" jdbcType="INTEGER" property="id" /> | |
7 | + <result column="userId" jdbcType="INTEGER" property="userId" /> | |
8 | + <result column="warehouseId" jdbcType="INTEGER" property="warehouseId" /> | |
9 | + <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" /> | |
10 | + </resultMap> | |
11 | + | |
12 | + <sql id="Base_Column_List"> | |
13 | + <!--@mbg.generated--> | |
14 | + id, userId, warehouseId, warehouseCode | |
15 | + </sql> | |
16 | + | |
17 | + <insert id="batchUserWarehouse"> | |
18 | + insert into sys_user_warehouse(userId, warehouseCode) values | |
19 | + <foreach item="item" index="index" collection="userWarehouseList" separator=","> | |
20 | + (#{item.userId},#{item.warehouseCode}) | |
21 | + </foreach> | |
22 | + </insert> | |
23 | + | |
24 | + <delete id="deleteUserWarehouseByUserId" parameterType="Integer"> | |
25 | + delete from sys_user_warehouse where userId=#{userId} | |
26 | + </delete> | |
27 | + | |
28 | + | |
29 | +</mapper> | |
30 | + | |
... | ... |
src/main/resources/mybatis/system/UserMapper.xml
... | ... | @@ -191,6 +191,14 @@ |
191 | 191 | INNER JOIN sys_role ON sys_user_role.roleId = sys_role.id AND sys_user_role.userId = sys_user.Id AND sys_role.enable = TRUE |
192 | 192 | INNER JOIN warehouse ON sys_role.warehouseCode = warehouse.code AND warehouse.enable = TRUE |
193 | 193 | </select> |
194 | + | |
195 | + <select id="getWarehouseByUserName" resultType="java.util.HashMap"> | |
196 | + SELECT r.`name`, r.code | |
197 | + FROM sys_user u | |
198 | + LEFT JOIN sys_user_warehouse ur ON u.id = ur.userId | |
199 | + LEFT JOIN warehouse r ON ur.warehouseCode = r.code | |
200 | + WHERE u.loginName=#{loginName,jdbcType=VARCHAR} | |
201 | + </select> | |
194 | 202 | |
195 | 203 | <update id="insertupdateTime" > |
196 | 204 | update sys_user set updateTime = #{date} where loginName = #{cPersonCode} |
... | ... |
src/main/resources/templates/config/containerCapacity/add.html
... | ... | @@ -6,23 +6,13 @@ |
6 | 6 | <div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
7 | 7 | <form class="form-horizontal m" id="form-containerCapacity-add"> |
8 | 8 | <div class="form-group"> |
9 | - <label class="col-sm-3 control-label">库区编码:</label> | |
9 | + <label class="col-sm-3 control-label">容器类型编码:</label> | |
10 | 10 | <div class="col-sm-8"> |
11 | - <select id="zonecode" name="zonecode" class="form-control" th:with="result=${@zone.getZoneCodeList()}"> | |
12 | - <option th:each="item : ${result}" th:text="${item['code']}" th:value="${item['code']}"></option> | |
13 | - </select> | |
11 | + <input id="containerType" name="containerType" class="form-control" type="text"> | |
14 | 12 | </div> |
15 | 13 | </div> |
16 | 14 | <div class="form-group"> |
17 | - <label class="col-sm-3 control-label">容器类型名称:</label> | |
18 | - <div class="col-sm-8"> | |
19 | - <select id="containercapacity" name="containercapacity" class="form-control" th:with="list=${@containerType.getAllContainerType()}"> | |
20 | - <option th:each="item : ${list}" th:text="${item['name']}" th:value="${item['name']}" th:attr = " containerTypeId = ${item['id']}, containerTypeCode = ${item['code']}"></option> | |
21 | - </select> | |
22 | - </div> | |
23 | - </div> | |
24 | - <div class="form-group"> | |
25 | - <label class="col-sm-3 control-label">物料编码:</label> | |
15 | + <label class="col-sm-3 control-label">商品编码:</label> | |
26 | 16 | <div class="col-sm-8"> |
27 | 17 | <input id="materialCode" name="materialCode" class="form-control" type="text"> |
28 | 18 | </div> |
... | ... | @@ -34,17 +24,12 @@ |
34 | 24 | <!--</div>--> |
35 | 25 | <!--</div>--> |
36 | 26 | <div class="form-group"> |
37 | - <label class="col-sm-3 control-label">上限值:</label> | |
38 | - <div class="col-sm-8"> | |
39 | - <input id="uph" name="uph" class="form-control" type="text"> | |
40 | - </div> | |
41 | - </div> | |
42 | - <div class="form-group"> | |
43 | - <label class="col-sm-3 control-label">备注:</label> | |
27 | + <label class="col-sm-3 control-label">存放数量:</label> | |
44 | 28 | <div class="col-sm-8"> |
45 | - <input id="remark" name="remark" class="form-control" type="text"> | |
29 | + <input id="qty" name="qty" class="form-control" type="text"> | |
46 | 30 | </div> |
47 | 31 | </div> |
32 | + | |
48 | 33 | <!--<div class="form-group"> --> |
49 | 34 | <!--<label class="col-sm-3 control-label">创建时间:</label>--> |
50 | 35 | <!--<div class="col-sm-8">--> |
... | ... | @@ -131,7 +116,7 @@ |
131 | 116 | var prefix = ctx + "config/containerCapacity"; |
132 | 117 | $("#form-containerCapacity-add").validate({ |
133 | 118 | rules:{ |
134 | - uph:{ | |
119 | + qty:{ | |
135 | 120 | required:true, |
136 | 121 | digits:true, |
137 | 122 | number:true, |
... | ... | @@ -146,12 +131,9 @@ |
146 | 131 | data : { |
147 | 132 | "enable" : $("input[name='enable']").is(':checked'), |
148 | 133 | "materialCode" :$("input[name='materialCode']").val(), |
149 | - "uph" :$("input[name='uph']").val(), | |
150 | - "remark" :$("input[name='remark']").val(), | |
151 | - "code" : $("#zonecode option:selected").val(), | |
152 | - "containerTypeName" : $("#containercapacity option:selected").val(), | |
153 | - "containerTypeId" : $("#containercapacity option:selected").attr("containerTypeId"), | |
154 | - "containerTypeCode": $("#containercapacity option:selected").attr("containerTypeCode"), | |
134 | + "qty" :$("input[name='qty']").val(), | |
135 | + "containerType" :$("input[name='containerType']").val(), | |
136 | + | |
155 | 137 | }, |
156 | 138 | async : false, |
157 | 139 | error : function(request) { |
... | ... |
src/main/resources/templates/config/containerCapacity/containerCapacity.html
... | ... | @@ -10,13 +10,13 @@ |
10 | 10 | <div class="select-list"> |
11 | 11 | <ul> |
12 | 12 | <li> |
13 | - 库区编码:<input type="text" name="code"/> | |
13 | + 容器类型编码:<input type="text" name="containerType"/> | |
14 | 14 | </li> |
15 | 15 | <li> |
16 | - 物料编码:<input type="text" name="materialCode"/> | |
16 | + 商品编码:<input type="text" name="materialCode"/> | |
17 | 17 | </li> |
18 | 18 | <li> |
19 | - 物料名称:<input type="text" name="materialName"/> | |
19 | + 商品名称:<input type="text" name="materialName"/> | |
20 | 20 | </li> |
21 | 21 | <!--<li>--> |
22 | 22 | <!--角色状态:<select name="enable" th:with="type=${@dict.getType('sys_normal_disable')}">--> |
... | ... | @@ -75,32 +75,24 @@ |
75 | 75 | title : '标识' |
76 | 76 | }, |
77 | 77 | { |
78 | - field : 'code', | |
79 | - title : '编码' | |
80 | - }, | |
81 | - { | |
82 | - field : 'containerTypeName', | |
83 | - title : '容器类型名称' | |
84 | - }, | |
85 | - { | |
86 | - field : 'containerTypeCode', | |
78 | + field : 'containerType', | |
87 | 79 | title : '容器类型编码' |
88 | 80 | }, |
89 | 81 | { |
90 | 82 | field : 'materialCode', |
91 | - title : '物料编码' | |
83 | + title : '商品编码' | |
92 | 84 | }, |
93 | 85 | { |
94 | 86 | field : 'materialName', |
95 | - title : '物料名称' | |
87 | + title : '商品名称' | |
96 | 88 | }, |
97 | 89 | { |
98 | - field : 'uph', | |
99 | - title : '上限值' | |
90 | + field : 'materialSpec', | |
91 | + title : '商品单位' | |
100 | 92 | }, |
101 | 93 | { |
102 | - field : 'remark', | |
103 | - title : '备注' | |
94 | + field : 'qty', | |
95 | + title : '存放数量' | |
104 | 96 | }, |
105 | 97 | { |
106 | 98 | field : 'created', |
... | ... |
src/main/resources/templates/config/containerCapacity/edit.html
... | ... | @@ -6,22 +6,7 @@ |
6 | 6 | <div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
7 | 7 | <form class="form-horizontal m" id="form-containerCapacity-edit" th:object="${containerCapacity}"> |
8 | 8 | <input id="id" name="id" th:field="*{id}" type="hidden"> |
9 | - <div class="form-group"> | |
10 | - <label class="col-sm-3 control-label">库区编码:</label> | |
11 | - <div class="col-sm-8"> | |
12 | - <select id="zonecode" name="zonecode" class="form-control" th:with="result=${@zone.getZoneCodeList()}" disabled="disabled"> | |
13 | - <option th:each="item : ${result}" th:field="*{code}" th:text="${item['code']}" th:value="${item['code']}"></option> | |
14 | - </select> | |
15 | - </div> | |
16 | - </div> | |
17 | - <div class="form-group"> | |
18 | - <label class="col-sm-3 control-label">容器类型名称:</label> | |
19 | - <div class="col-sm-8"> | |
20 | - <select id="containercapacity" name="containercapacity" class="form-control" th:with="list=${@containerType.getAllContainerType()}" disabled="disabled"> | |
21 | - <option th:each="item : ${list}" th:field="*{containerTypeName}" th:text="${item['name']}" th:value="${item['name']}" th:attr = " containerTypeId = ${item['id']}, containerTypeCode = ${item['code']}"></option> | |
22 | - </select> | |
23 | - </div> | |
24 | - </div> | |
9 | + | |
25 | 10 | <!--<div class="form-group"> --> |
26 | 11 | <!--<label class="col-sm-3 control-label">仓库Id:</label>--> |
27 | 12 | <!--<div class="col-sm-8">--> |
... | ... | @@ -35,29 +20,36 @@ |
35 | 20 | <!--</div>--> |
36 | 21 | <!--</div>--> |
37 | 22 | <div class="form-group"> |
38 | - <label class="col-sm-3 control-label">物料编码:</label> | |
23 | + <label class="col-sm-3 control-label">容器类型编码:</label> | |
24 | + <div class="col-sm-8"> | |
25 | + <input id="containerType" name="containerType" th:field="*{containerType}" class="form-control" type="text" readonly="readonly"> | |
26 | + </div> | |
27 | + </div> | |
28 | + <div class="form-group"> | |
29 | + <label class="col-sm-3 control-label">商品编码:</label> | |
39 | 30 | <div class="col-sm-8"> |
40 | - <input id="materialCode" name="materialCode" th:field="*{materialCode}" class="form-control" type="text" disabled="disabled"> | |
31 | + <input id="materialCode" name="materialCode" th:field="*{materialCode}" class="form-control" type="text" readonly="readonly"> | |
41 | 32 | </div> |
42 | 33 | </div> |
43 | 34 | <div class="form-group"> |
44 | - <label class="col-sm-3 control-label">物料名称:</label> | |
35 | + <label class="col-sm-3 control-label">商品名称:</label> | |
45 | 36 | <div class="col-sm-8"> |
46 | - <input id="materialName" name="materialName" th:field="*{materialName}" class="form-control" type="text" disabled="disabled"> | |
37 | + <input id="materialName" name="materialName" th:field="*{materialName}" class="form-control" type="text" readonly="readonly"> | |
47 | 38 | </div> |
48 | 39 | </div> |
49 | 40 | <div class="form-group"> |
50 | - <label class="col-sm-3 control-label">上限值:</label> | |
41 | + <label class="col-sm-3 control-label">商品规格:</label> | |
51 | 42 | <div class="col-sm-8"> |
52 | - <input id="uph" name="uph" th:field="*{uph}" class="form-control" type="text"> | |
43 | + <input id="materialSpec" name="materialSpec" th:field="*{materialSpec}" class="form-control" type="text" readonly="readonly"> | |
53 | 44 | </div> |
54 | 45 | </div> |
55 | 46 | <div class="form-group"> |
56 | - <label class="col-sm-3 control-label">备注:</label> | |
47 | + <label class="col-sm-3 control-label">存放数量:</label> | |
57 | 48 | <div class="col-sm-8"> |
58 | - <input id="remark" name="remark" th:field="*{remark}" class="form-control" type="text"> | |
49 | + <input id="qty" name="qty" th:field="*{qty}" class="form-control" type="text"> | |
59 | 50 | </div> |
60 | 51 | </div> |
52 | + | |
61 | 53 | <!--<div class="form-group"> --> |
62 | 54 | <!--<label class="col-sm-3 control-label">创建时间:</label>--> |
63 | 55 | <!--<div class="col-sm-8">--> |
... | ... | @@ -175,13 +167,11 @@ |
175 | 167 | "id": $("input[name='id']").val(), |
176 | 168 | "enable" : $("input[name='enable']").is(':checked'), |
177 | 169 | "code" : $("#zonecode option:selected").val(), |
178 | - "containerTypeName" : $("#containercapacity option:selected").val(), | |
179 | - "containerTypeId" : $("#containercapacity option:selected").attr("containerTypeId"), | |
180 | - "containerTypeCode": $("#containercapacity option:selected").attr("containerTypeCode"), | |
181 | 170 | "materialName" :$("input[name='materialName']").val(), |
182 | 171 | "materialCode" :$("input[name='materialCode']").val(), |
183 | - "uph" :$("input[name='uph']").val(), | |
184 | - "remark" :$("input[name='remark']").val(), | |
172 | + "qty" :$("input[name='qty']").val(), | |
173 | + "containerType" :$("input[name='containerType']").val(), | |
174 | + | |
185 | 175 | }, |
186 | 176 | async : false, |
187 | 177 | error : function(request) { |
... | ... |
src/main/resources/templates/config/zoneCapacity/edit.html
... | ... | @@ -7,98 +7,39 @@ |
7 | 7 | <form class="form-horizontal m" id="form-zoneCapacity-edit" th:object="${zoneCapacity}"> |
8 | 8 | <input id="id" name="id" th:field="*{id}" type="hidden"> |
9 | 9 | <div class="form-group"> |
10 | - <label class="col-sm-3 control-label">编码:</label> | |
10 | + <label class="col-sm-3 control-label">货位过滤条件:</label> | |
11 | 11 | <div class="col-sm-8"> |
12 | - <input id="code" name="code" th:field="*{code}" class="form-control" type="text"> | |
13 | - </div> | |
14 | - </div> | |
15 | - <div class="form-group"> | |
16 | - <label class="col-sm-3 control-label">名称:</label> | |
17 | - <div class="col-sm-8"> | |
18 | - <input id="name" name="name" th:field="*{name}" class="form-control" type="text"> | |
12 | + <input id="filterCode" name="filterCode" th:field="*{filterCode}" class="form-control" type="text" readonly="readonly"> | |
19 | 13 | </div> |
20 | 14 | </div> |
21 | 15 | <div class="form-group"> |
22 | - <label class="col-sm-3 control-label">物料:</label> | |
16 | + <label class="col-sm-3 control-label">商品编码:</label> | |
23 | 17 | <div class="col-sm-8"> |
24 | - <input id="materialCode" name="materialCode" th:field="*{materialCode}" class="form-control" type="text"> | |
25 | - <input id="materialId" name="materialId" th:field="*{materialId}" type="hidden"> | |
18 | + <input id="materialCode" name="materialCode" th:field="*{materialCode}" class="form-control" type="text" readonly="readonly"> | |
26 | 19 | </div> |
27 | 20 | </div> |
28 | 21 | <div class="form-group"> |
29 | - <label class="col-sm-3 control-label">物料类别:</label> | |
22 | + <label class="col-sm-3 control-label">商品名称:</label> | |
30 | 23 | <div class="col-sm-8"> |
31 | - <select id="materialType" name="materialType" th:field="*{materialType}" th:with="type=${@dict.getType('materialType')}" class="form-control"> | |
32 | - <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option> | |
33 | - </select> | |
24 | + <input id="materialName" name="materialName" th:field="*{materialName}" class="form-control" type="text" readonly="readonly"> | |
34 | 25 | </div> |
35 | 26 | </div> |
36 | 27 | <div class="form-group"> |
37 | - <label class="col-sm-3 control-label">仓库区域:</label> | |
28 | + <label class="col-sm-3 control-label">商品规格:</label> | |
38 | 29 | <div class="col-sm-8"> |
39 | - <select id="zoneId" name="zoneId" class="form-control" th:field="*{zoneId}" th:with="zones=${@zone.getZoneCodeList()}"> | |
40 | - <option th:each="zone: ${zones}" th:text="${zone['name']}" th:value="${zone['id']}"></option> | |
41 | - </select> | |
30 | + <input id="materialSpec" name="materialSpec" th:field="*{materialSpec}" class="form-control" type="text" readonly="readonly"> | |
42 | 31 | </div> |
43 | 32 | </div> |
44 | 33 | <div class="form-group"> |
45 | - <label class="col-sm-3 control-label">上限预警值:</label> | |
34 | + <label class="col-sm-3 control-label">最大数量:</label> | |
46 | 35 | <div class="col-sm-8"> |
47 | - <input id="uphAlarm" name="uphAlarm" th:field="*{uphAlarm}" class="form-control" type="text"> | |
36 | + <input id="maxQty" name="maxQty" th:field="*{maxQty}" class="form-control" type="text"> | |
48 | 37 | </div> |
49 | 38 | </div> |
50 | 39 | <div class="form-group"> |
51 | - <label class="col-sm-3 control-label">上限值:</label> | |
52 | - <div class="col-sm-8"> | |
53 | - <input id="uph" name="uph" th:field="*{uph}" class="form-control" type="text"> | |
54 | - </div> | |
55 | - </div> | |
56 | - <div class="form-group"> | |
57 | - <label class="col-sm-3 control-label">下限预警值:</label> | |
58 | - <div class="col-sm-8"> | |
59 | - <input id="lphAlarm" name="lphAlarm" th:field="*{lphAlarm}" class="form-control" type="text"> | |
60 | - </div> | |
61 | - </div> | |
62 | - <div class="form-group"> | |
63 | - <label class="col-sm-3 control-label">下限值:</label> | |
64 | - <div class="col-sm-8"> | |
65 | - <input id="lph" name="lph" th:field="*{lph}" class="form-control" type="text"> | |
66 | - </div> | |
67 | - </div> | |
68 | - <div class="form-group"> | |
69 | - <label class="col-sm-3 control-label">是否有效:</label> | |
70 | - <div class="col-sm-8"> | |
71 | - <div class="onoffswitch"> | |
72 | - <input type="checkbox" th:checked="*{enable}" class="onoffswitch-checkbox" id="enable" name="enable"> | |
73 | - <label class="onoffswitch-label" for="enable"> | |
74 | - <span class="onoffswitch-inner"></span> | |
75 | - <span class="onoffswitch-switch"></span> | |
76 | - </label> | |
77 | - </div> | |
78 | - </div> | |
79 | - </div> | |
80 | - <div class="form-group"> | |
81 | - <label class="col-sm-3 control-label">创建时间:</label> | |
40 | + <label class="col-sm-3 control-label">最小数量:</label> | |
82 | 41 | <div class="col-sm-8"> |
83 | - <input id="created" name="created" th:field="*{created}" class="form-control" type="text" readonly="readonly"> | |
84 | - </div> | |
85 | - </div> | |
86 | - <div class="form-group"> | |
87 | - <label class="col-sm-3 control-label">创建用户:</label> | |
88 | - <div class="col-sm-8"> | |
89 | - <input id="createdBy" name="createdBy" th:field="*{createdBy}" class="form-control" type="text" readonly="readonly"> | |
90 | - </div> | |
91 | - </div> | |
92 | - <div class="form-group"> | |
93 | - <label class="col-sm-3 control-label">创建时间:</label> | |
94 | - <div class="col-sm-8"> | |
95 | - <input id="lastUpdated" name="lastUpdated" th:field="*{lastUpdated}" class="form-control" type="text" readonly="readonly"> | |
96 | - </div> | |
97 | - </div> | |
98 | - <div class="form-group"> | |
99 | - <label class="col-sm-3 control-label">更新用户:</label> | |
100 | - <div class="col-sm-8"> | |
101 | - <input id="lastUpdatedBy" name="lastUpdatedBy" th:field="*{lastUpdatedBy}" class="form-control" type="text" readonly="readonly"> | |
42 | + <input id="minQty" name="minQty" th:field="*{minQty}" class="form-control" type="text"> | |
102 | 43 | </div> |
103 | 44 | </div> |
104 | 45 | <div class="form-group"> |
... | ... | @@ -114,30 +55,23 @@ |
114 | 55 | var prefix = ctx + "config/zoneCapacity" |
115 | 56 | $("#form-zoneCapacity-edit").validate({ |
116 | 57 | rules:{ |
117 | - code:{ | |
118 | - required:true, | |
119 | - }, | |
120 | - name:{ | |
58 | + filterCode:{ | |
121 | 59 | required:true, |
122 | 60 | }, |
123 | 61 | materialCode:{ |
124 | 62 | required:true, |
125 | 63 | }, |
126 | - uphAlarm:{ | |
64 | + materialName:{ | |
127 | 65 | required:true, |
128 | - range:[0, 100] | |
129 | 66 | }, |
130 | - uph:{ | |
67 | + materialSpec:{ | |
131 | 68 | required:true, |
132 | - range:[0, 100] | |
133 | 69 | }, |
134 | - lphAlarm:{ | |
70 | + maxQty:{ | |
135 | 71 | required:true, |
136 | - range:[0, 100] | |
137 | 72 | }, |
138 | - lph:{ | |
73 | + minQty:{ | |
139 | 74 | required:true, |
140 | - range:[0, 100] | |
141 | 75 | }, |
142 | 76 | }, |
143 | 77 | submitHandler: function(form) { |
... | ... |
src/main/resources/templates/system/user/add.html
... | ... | @@ -71,6 +71,16 @@ |
71 | 71 | </label> |
72 | 72 | </div> |
73 | 73 | </div> |
74 | + | |
75 | + <div class="form-group"> | |
76 | + <label class="col-sm-3 control-label">仓库:</label> | |
77 | + <div class="col-sm-8"> | |
78 | + <label th:each="warehouse:${warehouseList}" class="checkbox-inline i-checks"> | |
79 | + <input name="warehouseCode" type="checkbox" th:value="${warehouse.value}" th:text=" ${warehouse.name}" th:disabled="${warehouse.enable == false} "> | |
80 | + </label> | |
81 | + </div> | |
82 | + </div> | |
83 | + | |
74 | 84 | <div class="form-group"> |
75 | 85 | <label class="col-sm-3 control-label">角色:</label> |
76 | 86 | <div class="col-sm-8"> |
... | ... | @@ -188,6 +198,7 @@ |
188 | 198 | var sex = $("#sex option:selected").val(); |
189 | 199 | var enable = $("input[name='enable']").is(':checked') == true ? 1 : 0; |
190 | 200 | var roleIds = $.form.selectCheckeds("role"); |
201 | + var warehouseCodeList = $.form.selectCheckeds("warehouseCode"); | |
191 | 202 | var companyIdList = $.form.selectCheckeds("company"); |
192 | 203 | $.ajax({ |
193 | 204 | cache : true, |
... | ... | @@ -204,6 +215,7 @@ |
204 | 215 | "sex": sex, |
205 | 216 | "enable": enable, |
206 | 217 | "roleIds": roleIds, |
218 | + "warehouseCodeList": warehouseCodeList, | |
207 | 219 | "companyIdList": companyIdList |
208 | 220 | }, |
209 | 221 | async : false, |
... | ... |
src/main/resources/templates/system/user/edit.html
... | ... | @@ -66,6 +66,16 @@ |
66 | 66 | </label> |
67 | 67 | </div> |
68 | 68 | </div> |
69 | + | |
70 | + <div class="form-group"> | |
71 | + <label class="col-sm-3 control-label">仓库:</label> | |
72 | + <div class="col-sm-8"> | |
73 | + <label th:each="warehouse:${warehouses}" class="checkbox-inline i-checks"> | |
74 | + <input name="warehouse" type="checkbox" th:value="${warehouse.code}" th:text="${warehouse.name}" th:checked="${warehouse.flag}" th:disabled="${warehouse.enable == false}"> | |
75 | + </label> | |
76 | + </div> | |
77 | + </div> | |
78 | + | |
69 | 79 | <div class="form-group"> |
70 | 80 | <label class="col-sm-3 control-label">角色:</label> |
71 | 81 | <div class="col-sm-8"> |
... | ... | @@ -160,6 +170,7 @@ |
160 | 170 | var sex = $("#sex option:selected").val(); |
161 | 171 | var enable = $("input[name='enable']").is(':checked') == true ? 1 : 0; |
162 | 172 | var roleIds = $.form.selectCheckeds("role"); |
173 | + var warehouseCodeList = $.form.selectCheckeds("warehouse"); | |
163 | 174 | var companyIdList = $.form.selectCheckeds("company"); |
164 | 175 | $.ajax({ |
165 | 176 | cache : true, |
... | ... | @@ -174,6 +185,7 @@ |
174 | 185 | "sex": sex, |
175 | 186 | "enable": enable, |
176 | 187 | "roleIds": roleIds, |
188 | + "warehouseCodeList": warehouseCodeList, | |
177 | 189 | "companyIdList": companyIdList |
178 | 190 | }, |
179 | 191 | async : false, |
... | ... |