Commit caad6ecaa344b2f0dd8e91395ee8f724e47ab791
Merge remote-tracking branch 'origin/develop' into develop
# Conflicts: # src/main/java/com/huaheng/pc/config/warehouse/service/WarehouseServiceImpl.java
Showing
35 changed files
with
436 additions
and
15 deletions
src/main/java/com/huaheng/pc/config/FilterConfigDetail/mapper/FilterConfigDetailMapper.java
... | ... | @@ -2,6 +2,14 @@ package com.huaheng.pc.config.FilterConfigDetail.mapper; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | 4 | import com.huaheng.pc.config.FilterConfigDetail.domain.FilterConfigDetail; |
5 | +import org.apache.ibatis.annotations.Param; | |
5 | 6 | |
6 | 7 | public interface FilterConfigDetailMapper extends BaseMapper<FilterConfigDetail> { |
8 | + | |
9 | + //复制规则配置明细 | |
10 | + int filterConfigDetailCopy(@Param("code") String code, @Param("newCode") String newCode); | |
11 | + | |
12 | + //修改规则配置明细headerId | |
13 | + int updateHeaderId(@Param("code") String code); | |
14 | + | |
7 | 15 | } |
8 | 16 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/config/FilterConfigHeader/mapper/FilterConfigHeaderMapper.java
... | ... | @@ -2,6 +2,10 @@ package com.huaheng.pc.config.FilterConfigHeader.mapper; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | 4 | import com.huaheng.pc.config.FilterConfigHeader.domain.FilterConfigHeader; |
5 | +import org.apache.ibatis.annotations.Param; | |
5 | 6 | |
6 | 7 | public interface FilterConfigHeaderMapper extends BaseMapper<FilterConfigHeader> { |
8 | + | |
9 | + //复制规则配置主表 | |
10 | + int filterConfigHeaderCopy(@Param("code") String code, @Param("newCode") String newCode); | |
7 | 11 | } |
8 | 12 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/config/FilterConfigHeader/service/FilterConfigHeaderService.java
... | ... | @@ -3,16 +3,25 @@ package com.huaheng.pc.config.FilterConfigHeader.service; |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
6 | +import com.huaheng.common.exception.service.ServiceException; | |
6 | 7 | import com.huaheng.common.utils.security.ShiroUtils; |
8 | +import com.huaheng.pc.config.FilterConfigDetail.mapper.FilterConfigDetailMapper; | |
7 | 9 | import com.huaheng.pc.config.FilterConfigHeader.domain.FilterConfigHeader; |
8 | 10 | import com.huaheng.pc.config.FilterConfigHeader.mapper.FilterConfigHeaderMapper; |
9 | 11 | import org.springframework.stereotype.Service; |
10 | 12 | |
13 | +import javax.annotation.Resource; | |
11 | 14 | import java.util.List; |
12 | 15 | |
13 | 16 | @Service("filterConfigHeaderService") |
14 | 17 | public class FilterConfigHeaderService extends ServiceImpl<FilterConfigHeaderMapper, FilterConfigHeader> { |
15 | 18 | |
19 | + @Resource | |
20 | + private FilterConfigHeaderMapper filterConfigHeaderMapper; | |
21 | + | |
22 | + @Resource | |
23 | + private FilterConfigDetailMapper filterConfigDetailMapper; | |
24 | + | |
16 | 25 | |
17 | 26 | //根据模块和类型查找具体规则 |
18 | 27 | public List<FilterConfigHeader> getFilterConfigHeaderService(String moduleType,String recordType){ |
... | ... | @@ -22,4 +31,28 @@ public class FilterConfigHeaderService extends ServiceImpl<FilterConfigHeaderMap |
22 | 31 | .eq(FilterConfigHeader::getWarehouseCode, ShiroUtils.getWarehouseCode()); |
23 | 32 | return this.list(lam); |
24 | 33 | } |
34 | + | |
35 | + | |
36 | + //复制规则配置 | |
37 | + public Boolean filterConfigCopy(String code,String newCode){ | |
38 | + int i = 0; | |
39 | + //复制规则配置主表 | |
40 | + i = filterConfigHeaderMapper.filterConfigHeaderCopy(code,newCode); | |
41 | + if(i < 1){ | |
42 | + throw new ServiceException("复制菜单数据失败"); | |
43 | + } | |
44 | + | |
45 | + //复制规则配置明细 | |
46 | + i = filterConfigDetailMapper.filterConfigDetailCopy(code,newCode); | |
47 | + if(i < 1){ | |
48 | + throw new ServiceException("复制菜单数据失败"); | |
49 | + } | |
50 | + | |
51 | + //修改规则配置明细headerId | |
52 | + i = filterConfigDetailMapper.updateHeaderId(newCode); | |
53 | + if(i < 1){ | |
54 | + throw new ServiceException("复制菜单数据失败"); | |
55 | + } | |
56 | + return true; | |
57 | + } | |
25 | 58 | } |
... | ... |
src/main/java/com/huaheng/pc/config/shipmentType/config/shipmentTypeController.java renamed to src/main/java/com/huaheng/pc/config/shipmentType/controller/shipmentTypeController.java
src/main/java/com/huaheng/pc/config/statusFlow/mapper/StatusFlowDetailMapper.java
... | ... | @@ -2,6 +2,13 @@ package com.huaheng.pc.config.statusFlow.mapper; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | 4 | import com.huaheng.pc.config.statusFlow.domain.StatusFlowDetail; |
5 | +import org.apache.ibatis.annotations.Param; | |
5 | 6 | |
6 | 7 | public interface StatusFlowDetailMapper extends BaseMapper<StatusFlowDetail> { |
8 | + | |
9 | + //复制流程明细 | |
10 | + int statusFlowDetailCopy(@Param("code") String code, @Param("newCode") String newCode); | |
11 | + | |
12 | + //修改流程明细headerId | |
13 | + int updateHeaderId(@Param("code") String code); | |
7 | 14 | } |
8 | 15 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/config/statusFlow/mapper/StatusFlowHeaderMapper.java
... | ... | @@ -2,6 +2,10 @@ package com.huaheng.pc.config.statusFlow.mapper; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | 4 | import com.huaheng.pc.config.statusFlow.domain.StatusFlowHeader; |
5 | +import org.apache.ibatis.annotations.Param; | |
5 | 6 | |
6 | 7 | public interface StatusFlowHeaderMapper extends BaseMapper<StatusFlowHeader> { |
8 | + | |
9 | + //复制流程主表 | |
10 | + int statusFlowHeaderCopy(@Param("code") String code, @Param("newCode") String newCode); | |
7 | 11 | } |
8 | 12 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/config/statusFlow/service/StatusFlowHeaderService.java
... | ... | @@ -2,19 +2,27 @@ package com.huaheng.pc.config.statusFlow.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.exception.service.ServiceException; | |
5 | 6 | import com.huaheng.common.utils.security.ShiroUtils; |
6 | -import org.springframework.aop.aspectj.AspectJPrecedenceInformation; | |
7 | +import com.huaheng.pc.config.statusFlow.mapper.StatusFlowDetailMapper; | |
7 | 8 | import org.springframework.stereotype.Service; |
8 | 9 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
9 | 10 | import com.huaheng.pc.config.statusFlow.domain.StatusFlowHeader; |
10 | 11 | import com.huaheng.pc.config.statusFlow.mapper.StatusFlowHeaderMapper; |
11 | 12 | |
13 | +import javax.annotation.Resource; | |
12 | 14 | import java.util.List; |
13 | 15 | import java.util.Map; |
14 | 16 | |
15 | 17 | @Service("StatusFlow") |
16 | 18 | public class StatusFlowHeaderService extends ServiceImpl<StatusFlowHeaderMapper, StatusFlowHeader> { |
17 | 19 | |
20 | + @Resource | |
21 | + private StatusFlowHeaderMapper statusFlowHeaderMapper; | |
22 | + @Resource | |
23 | + private StatusFlowDetailMapper statusFlowDetailMapper; | |
24 | + | |
25 | + | |
18 | 26 | public List<Map<String, Object>> flowList(String recordType){ |
19 | 27 | LambdaQueryWrapper<StatusFlowHeader> lambda = Wrappers.lambdaQuery(); |
20 | 28 | lambda.select(StatusFlowHeader::getCode, StatusFlowHeader::getName) |
... | ... | @@ -30,4 +38,28 @@ public class StatusFlowHeaderService extends ServiceImpl<StatusFlowHeaderMapper, |
30 | 38 | .eq(StatusFlowHeader::getWarehouseCode, ShiroUtils.getWarehouseCode()); |
31 | 39 | return this.list(lambda); |
32 | 40 | } |
41 | + | |
42 | + | |
43 | + //复制流程 | |
44 | + public Boolean statusFlowCopy(String code,String newCode){ | |
45 | + int i = 0; | |
46 | + //复制流程主表 | |
47 | + i = statusFlowHeaderMapper.statusFlowHeaderCopy(code,newCode); | |
48 | + if(i < 1){ | |
49 | + throw new ServiceException("复制菜单数据失败"); | |
50 | + } | |
51 | + | |
52 | + //复制流程明细 | |
53 | + i = statusFlowDetailMapper.statusFlowDetailCopy(code,newCode); | |
54 | + if(i < 1){ | |
55 | + throw new ServiceException("复制菜单数据失败"); | |
56 | + } | |
57 | + | |
58 | + //修改流程明细headerId | |
59 | + i = statusFlowDetailMapper.updateHeaderId(newCode); | |
60 | + if(i < 1){ | |
61 | + throw new ServiceException("复制菜单数据失败"); | |
62 | + } | |
63 | + return true; | |
64 | + } | |
33 | 65 | } |
... | ... |
src/main/java/com/huaheng/pc/config/warehouse/service/WarehouseServiceImpl.java
... | ... | @@ -4,21 +4,35 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
6 | 6 | import com.huaheng.common.exception.service.ServiceException; |
7 | +import com.huaheng.pc.config.address.domain.Address; | |
7 | 8 | import com.huaheng.pc.config.address.service.AddressService; |
9 | +import com.huaheng.pc.config.configValue.domain.ConfigValue; | |
8 | 10 | import com.huaheng.pc.config.configValue.service.ConfigValueService; |
9 | 11 | import com.huaheng.pc.config.containerType.service.ContainerTypeService; |
12 | +import com.huaheng.pc.config.cycleCountPreference.domain.CycleCountPreference; | |
10 | 13 | import com.huaheng.pc.config.cycleCountPreference.service.CycleCountPreferenceService; |
14 | +import com.huaheng.pc.config.locationType.domain.LocationType; | |
11 | 15 | import com.huaheng.pc.config.locationType.service.LocationTypeService; |
12 | 16 | import com.huaheng.pc.config.receiptPreference.service.ReceiptPreferenceService; |
13 | 17 | import com.huaheng.pc.config.receiptType.service.ReceiptTypeService; |
18 | +import com.huaheng.pc.config.shipmentPreference.domain.ShipmentPreference; | |
14 | 19 | import com.huaheng.pc.config.shipmentPreference.service.ShipmentPreferenceService; |
15 | 20 | import com.huaheng.pc.config.shipmentType.service.ShipmentTypeService; |
21 | +import com.huaheng.pc.config.statusFlow.service.StatusFlowHeaderService; | |
16 | 22 | import com.huaheng.pc.config.warehouse.domain.Warehouse; |
17 | 23 | import com.huaheng.pc.config.warehouse.mapper.WarehouseMapper; |
18 | 24 | import com.huaheng.pc.config.warehouseCompany.domain.WarehouseCompany; |
19 | 25 | import com.huaheng.pc.config.warehouseCompany.service.WarehouseCompanyService; |
26 | +import com.huaheng.pc.config.waveMaster.service.WaveMasterService; | |
27 | +import com.huaheng.pc.shipment.wave.service.WaveService; | |
28 | +import com.huaheng.pc.system.dict.service.IDictTypeService; | |
29 | +import com.huaheng.pc.system.menu.service.IMenuService; | |
30 | +import com.huaheng.pc.system.menu.service.MenuServiceImpl; | |
31 | +import com.huaheng.pc.system.role.service.IRoleService; | |
32 | +import org.springframework.beans.factory.annotation.Autowired; | |
20 | 33 | import org.springframework.stereotype.Service; |
21 | 34 | import org.springframework.transaction.annotation.Transactional; |
35 | +import sun.util.resources.cldr.ext.CurrencyNames_rof; | |
22 | 36 | |
23 | 37 | import javax.annotation.Resource; |
24 | 38 | import java.util.List; |
... | ... | @@ -49,6 +63,18 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper, Warehouse |
49 | 63 | private WarehouseMapper warehouseMapper; |
50 | 64 | @Resource |
51 | 65 | private WarehouseCompanyService warehouseCompanyService; |
66 | + @Autowired | |
67 | + private IRoleService roleService; | |
68 | + @Autowired | |
69 | + private IDictTypeService dictTypeService; | |
70 | + @Autowired | |
71 | + private IMenuService menuService; | |
72 | + @Autowired | |
73 | + private FilterConfigHeaderService filterConfigHeaderService; | |
74 | + @Autowired | |
75 | + private StatusFlowHeaderService statusFlowHeaderService; | |
76 | + @Autowired | |
77 | + private WaveMasterService waveMasterService; | |
52 | 78 | |
53 | 79 | @Override |
54 | 80 | public List<Map<String, Object>> getWarehouseList(Integer id) { |
... | ... | @@ -116,26 +142,54 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper, Warehouse |
116 | 142 | if (!containerTypeService.containerTypeCopy(warehouseCode, newWarehouseCode)){ |
117 | 143 | throw new ServiceException("复制容器类型表失败"); |
118 | 144 | } |
119 | - /* 复制盘点首选项表*/ | |
120 | - if (!cycleCountPreferenceService.cycleCountPreferenceCopy(warehouseCode, newWarehouseCode)){ | |
121 | - throw new ServiceException("复制盘点首选项表失败"); | |
122 | - } | |
123 | 145 | /* 复制库位类型表*/ |
124 | 146 | if (!locationTypeService.locationTypeCopy(warehouseCode, newWarehouseCode)){ |
125 | 147 | throw new ServiceException("复制库位类型表失败"); |
126 | 148 | } |
149 | + /* 复制盘点首选项表*/ | |
150 | + if (!cycleCountPreferenceService.cycleCountPreferenceCopy(warehouseCode, newWarehouseCode)){ | |
151 | + throw new ServiceException("复制盘点首选项表失败"); | |
152 | + } | |
153 | + /* 复制入库首选项*/ | |
127 | 154 | if (!receiptPreferenceService.receiptPreferenceCopy(warehouseCode, newWarehouseCode)){ |
128 | 155 | throw new ServiceException("复制入库首选项表失败"); |
129 | 156 | } |
130 | - if (!receiptTypeService.receiptTypeCopy(warehouseCode, newWarehouseCode)){ | |
131 | - throw new ServiceException("复制入库类型表失败"); | |
132 | - } | |
157 | + /* 复制出库首选项*/ | |
133 | 158 | if (!shipmentPreferenceService.shipmentPreferenceCopy(warehouseCode, newWarehouseCode)){ |
134 | 159 | throw new ServiceException("复制出库首选项表失败"); |
135 | 160 | } |
161 | + /* 复制入库类型*/ | |
162 | + if (!receiptTypeService.receiptTypeCopy(warehouseCode, newWarehouseCode)){ | |
163 | + throw new ServiceException("复制入库类型表失败"); | |
164 | + } | |
165 | + /* 复制出库类型*/ | |
136 | 166 | if (!shipmentTypeService.ShipmentTypeCopy(warehouseCode, newWarehouseCode)){ |
137 | 167 | throw new ServiceException("复制出库类型表失败"); |
138 | 168 | } |
169 | + /* 复制角色*/ | |
170 | + if (!roleService.roleCopy(warehouseCode, newWarehouseCode)){ | |
171 | + throw new ServiceException("复制角色表失败"); | |
172 | + } | |
173 | + /* 复制字典数据*/ | |
174 | + if (!dictTypeService.dictTypeCopy(warehouseCode, newWarehouseCode)){ | |
175 | + throw new ServiceException("复制字典数据表失败"); | |
176 | + } | |
177 | + /* 复制菜单*/ | |
178 | + if (!menuService.menuCopy(warehouseCode, newWarehouseCode)){ | |
179 | + throw new ServiceException("复制菜单表失败"); | |
180 | + } | |
181 | + /* 复制流程*/ | |
182 | + if (!statusFlowHeaderService.statusFlowCopy(warehouseCode, newWarehouseCode)){ | |
183 | + throw new ServiceException("复制流程表失败"); | |
184 | + } | |
185 | + /* 复制规则配置*/ | |
186 | + if (!filterConfigHeaderService.filterConfigCopy(warehouseCode, newWarehouseCode)){ | |
187 | + throw new ServiceException("复制规则配置表失败"); | |
188 | + } | |
189 | + /* 复制波次配置*/ | |
190 | + if (!waveMasterService.waveMasterCopy(warehouseCode, newWarehouseCode)){ | |
191 | + throw new ServiceException("复制波次配置表失败"); | |
192 | + } | |
139 | 193 | return true; |
140 | 194 | } |
141 | 195 | } |
... | ... |
src/main/java/com/huaheng/pc/config/waveFlowDetail/mapper/WaveFlowDetailMapper.java
... | ... | @@ -2,6 +2,13 @@ package com.huaheng.pc.config.waveFlowDetail.mapper; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | 4 | import com.huaheng.pc.config.waveFlowDetail.domain.WaveFlowDetail; |
5 | +import org.apache.ibatis.annotations.Param; | |
5 | 6 | |
6 | 7 | public interface WaveFlowDetailMapper extends BaseMapper<WaveFlowDetail> { |
8 | + | |
9 | + //复制波次流程明细 | |
10 | + int waveFlowDetailCopy(@Param("code") String code, @Param("newCode") String newCode); | |
11 | + | |
12 | + //修改波次流程明细headerId | |
13 | + int updateHeaderId(@Param("code") String code); | |
7 | 14 | } |
8 | 15 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/config/waveFlowHeader/mapper/WaveFlowHeaderMapper.java
... | ... | @@ -2,6 +2,11 @@ package com.huaheng.pc.config.waveFlowHeader.mapper; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | 4 | import com.huaheng.pc.config.waveFlowHeader.domain.WaveFlowHeader; |
5 | +import org.apache.ibatis.annotations.Param; | |
5 | 6 | |
6 | 7 | public interface WaveFlowHeaderMapper extends BaseMapper<WaveFlowHeader> { |
8 | + | |
9 | + //复制波次流程主表 | |
10 | + int waveFlowHeaderCopy(@Param("code") String code, @Param("newCode") String newCode); | |
11 | + | |
7 | 12 | } |
8 | 13 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/config/waveMaster/mapper/WaveMasterMapper.java
... | ... | @@ -2,6 +2,10 @@ package com.huaheng.pc.config.waveMaster.mapper; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
4 | 4 | import com.huaheng.pc.config.waveMaster.domain.WaveMaster; |
5 | +import org.apache.ibatis.annotations.Param; | |
5 | 6 | |
6 | 7 | public interface WaveMasterMapper extends BaseMapper<WaveMaster> { |
8 | + | |
9 | + //复制波次配置 | |
10 | + int waveMasterCopy(@Param("code") String code, @Param("newCode") String newCode); | |
7 | 11 | } |
8 | 12 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/config/waveMaster/service/WaveMasterService.java
1 | 1 | package com.huaheng.pc.config.waveMaster.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
4 | +import com.huaheng.common.exception.service.ServiceException; | |
5 | +import com.huaheng.pc.config.waveFlowDetail.domain.WaveFlowDetail; | |
6 | +import com.huaheng.pc.config.waveFlowDetail.mapper.WaveFlowDetailMapper; | |
7 | +import com.huaheng.pc.config.waveFlowHeader.domain.WaveFlowHeader; | |
8 | +import com.huaheng.pc.config.waveFlowHeader.mapper.WaveFlowHeaderMapper; | |
4 | 9 | import com.huaheng.pc.config.waveMaster.domain.WaveMaster; |
5 | 10 | import com.huaheng.pc.config.waveMaster.mapper.WaveMasterMapper; |
6 | 11 | import org.springframework.stereotype.Service; |
7 | 12 | |
13 | +import javax.annotation.Resource; | |
14 | + | |
8 | 15 | @Service |
9 | 16 | public class WaveMasterService extends ServiceImpl<WaveMasterMapper, WaveMaster> { |
10 | 17 | |
18 | + @Resource | |
19 | + private WaveMasterMapper waveMasterMapper; | |
20 | + @Resource | |
21 | + private WaveFlowHeaderMapper waveFlowHeaderMapper; | |
22 | + @Resource | |
23 | + private WaveFlowDetailMapper waveFlowDetailMapper; | |
24 | + | |
25 | + | |
26 | + | |
27 | + //复制波次配置 | |
28 | + public Boolean waveMasterCopy(String code,String newCode){ | |
29 | + int i = 0; | |
30 | + //复制波次配置 | |
31 | + i = waveMasterMapper.waveMasterCopy(code,newCode); | |
32 | + if(i < 1){ | |
33 | + throw new ServiceException("复制菜单数据失败"); | |
34 | + } | |
35 | + | |
36 | + //复制波次流程主表 | |
37 | + i = waveFlowHeaderMapper.waveFlowHeaderCopy(code,newCode); | |
38 | + if(i < 1){ | |
39 | + throw new ServiceException("复制菜单数据失败"); | |
40 | + } | |
41 | + | |
42 | + //复制波次流程明细 | |
43 | + i = waveFlowDetailMapper.waveFlowDetailCopy(code,newCode); | |
44 | + if(i < 1){ | |
45 | + throw new ServiceException("复制菜单数据失败"); | |
46 | + } | |
47 | + | |
48 | + //修改波次流程明细headerId | |
49 | + i = waveFlowDetailMapper.updateHeaderId(newCode); | |
50 | + if(i < 1){ | |
51 | + throw new ServiceException("复制菜单数据失败"); | |
52 | + } | |
53 | + return null; | |
54 | + } | |
55 | + | |
11 | 56 | } |
... | ... |
src/main/java/com/huaheng/pc/system/dict/mapper/DictDataMapper.java
... | ... | @@ -115,4 +115,10 @@ public interface DictDataMapper |
115 | 115 | |
116 | 116 | DictData selectModel(DictData dictData); |
117 | 117 | |
118 | + //复制字典明细数据 | |
119 | + int dictDateCopy(@Param("code")String code, @Param("newCode")String newCode); | |
120 | + | |
121 | + | |
122 | + //修改复制明细的父ID | |
123 | + int updateHeaderId(@Param("code")String code); | |
118 | 124 | } |
... | ... |
src/main/java/com/huaheng/pc/system/dict/mapper/DictTypeMapper.java
src/main/java/com/huaheng/pc/system/dict/service/DictTypeServiceImpl.java
1 | 1 | package com.huaheng.pc.system.dict.service; |
2 | 2 | |
3 | +import com.huaheng.common.exception.service.ServiceException; | |
3 | 4 | import org.apache.ibatis.annotations.Param; |
4 | 5 | import org.springframework.beans.factory.annotation.Autowired; |
5 | 6 | import org.springframework.stereotype.Service; |
... | ... | @@ -176,4 +177,26 @@ public class DictTypeServiceImpl implements IDictTypeService |
176 | 177 | |
177 | 178 | return dictTypeMapper.insertDictTypes(dictTypeList); |
178 | 179 | } |
180 | + | |
181 | + //复制字典数据 | |
182 | + @Override | |
183 | + public Boolean dictTypeCopy(String code, String newCode) { | |
184 | + int i = 0; | |
185 | + //1、先复制字典主表数据 | |
186 | + i = dictTypeMapper.dictTypeCopy(code,newCode); | |
187 | + if(i < 1){ | |
188 | + throw new ServiceException("复制字典主表失败"); | |
189 | + } | |
190 | + //2、复制字典明细数据 | |
191 | + i = dictDataMapper.dictDateCopy(code,newCode); | |
192 | + if(i < 1){ | |
193 | + throw new ServiceException("复制字典明细失败"); | |
194 | + } | |
195 | + //3、修改复制明细的父ID | |
196 | + i = dictDataMapper.updateHeaderId(newCode); | |
197 | + if(i < 1){ | |
198 | + throw new ServiceException("修改字典明细失败"); | |
199 | + } | |
200 | + return null; | |
201 | + } | |
179 | 202 | } |
... | ... |
src/main/java/com/huaheng/pc/system/dict/service/IDictTypeService.java
src/main/java/com/huaheng/pc/system/menu/mapper/MenuMapper.java
... | ... | @@ -118,4 +118,10 @@ public interface MenuMapper extends BaseMapper<Menu> |
118 | 118 | public List<Menu> selectMobileMenusByUserId(@Param("warehouseCode") String warehouseCode, @Param("userId") Integer userId); |
119 | 119 | |
120 | 120 | List<Menu> selectMenuPageList(Menu menu); |
121 | + | |
122 | + //复制菜单数据 | |
123 | + int menuCopy(@Param("code") String code, @Param("newCode") String newCode); | |
124 | + | |
125 | + //修改父id | |
126 | + int updateParentId(@Param("code") String code); | |
121 | 127 | } |
... | ... |
src/main/java/com/huaheng/pc/system/menu/service/IMenuService.java
src/main/java/com/huaheng/pc/system/menu/service/MenuServiceImpl.java
... | ... | @@ -10,6 +10,7 @@ import java.util.List; |
10 | 10 | import java.util.Map; |
11 | 11 | import java.util.Set; |
12 | 12 | |
13 | +import com.huaheng.common.exception.service.ServiceException; | |
13 | 14 | import com.huaheng.pc.system.user.domain.User; |
14 | 15 | import org.springframework.beans.factory.annotation.Autowired; |
15 | 16 | import org.springframework.stereotype.Service; |
... | ... | @@ -354,5 +355,22 @@ public class MenuServiceImpl implements IMenuService |
354 | 355 | return menus; |
355 | 356 | } |
356 | 357 | |
358 | + //复制菜单 | |
359 | + @Override | |
360 | + public Boolean menuCopy(String code, String newCode) { | |
361 | + int i = 0; | |
362 | + //复制菜单数据 | |
363 | + i = menuMapper.menuCopy(code,newCode); | |
364 | + if(i < 1){ | |
365 | + throw new ServiceException("复制菜单数据失败"); | |
366 | + } | |
367 | + //修改父id | |
368 | + i= menuMapper.updateParentId(newCode); | |
369 | + if(i < 1){ | |
370 | + throw new ServiceException("修改父Id失败"); | |
371 | + } | |
372 | + return true; | |
373 | + } | |
374 | + | |
357 | 375 | |
358 | 376 | } |
... | ... |
src/main/java/com/huaheng/pc/system/role/mapper/RoleMapper.java
... | ... | @@ -91,4 +91,7 @@ public interface RoleMapper |
91 | 91 | */ |
92 | 92 | public Role checkroleCodeUnique(@Param("warehouseCode") String warehouseCode, @Param("roleCode") String roleCode); |
93 | 93 | |
94 | + | |
95 | + public int roleCopy(@Param("code")String code, @Param("newCode")String newCode); | |
96 | + | |
94 | 97 | } |
... | ... |
src/main/java/com/huaheng/pc/system/role/service/IRoleService.java
src/main/java/com/huaheng/pc/system/role/service/RoleServiceImpl.java
... | ... | @@ -259,4 +259,15 @@ public class RoleServiceImpl implements IRoleService |
259 | 259 | return userRoleMapper.countUserRoleByRoleId(id); |
260 | 260 | } |
261 | 261 | |
262 | + | |
263 | + //复制角色 | |
264 | + @Override | |
265 | + public Boolean roleCopy(String code, String newCode) { | |
266 | + int i = roleMapper.roleCopy(code,newCode); | |
267 | + if(i > 0){ | |
268 | + return true; | |
269 | + } | |
270 | + return false; | |
271 | + } | |
272 | + | |
262 | 273 | } |
... | ... |
src/main/resources/mybatis/config/FilterConfigDetailMapper.xml
... | ... | @@ -33,4 +33,24 @@ |
33 | 33 | version, userDef1, userDef2, userDef3, userDef4, |
34 | 34 | processStamp, filterName |
35 | 35 | </sql> |
36 | + | |
37 | + | |
38 | + <insert id="filterConfigDetailCopy"> | |
39 | + insert into filter_config_detail(headerId, code, moduleType, recordType, filterCode, warehouseCode, description, | |
40 | + `statement`,statements, systemCreated, customSql, createdBy, lastUpdatedBy, | |
41 | + version,processStamp, filterName) | |
42 | + select headerId, code, moduleType, recordType, filterCode, #{newCode}, description, | |
43 | + `statement`,statements, systemCreated, customSql,createdBy, lastUpdatedBy,version, | |
44 | + processStamp, filterName from filter_config_detail | |
45 | + where warehouseCode =#{code} | |
46 | + | |
47 | + </insert> | |
48 | + | |
49 | + <update id="updateHeaderId"> | |
50 | + update filter_config_detail d | |
51 | + inner join filter_config_header t | |
52 | + on t.filterCode=d.filterCode and d.warehouseCode=t.warehouseCode and d.warehouseCode=#{code} | |
53 | + set d.headerId=t.id | |
54 | + | |
55 | + </update> | |
36 | 56 | </mapper> |
37 | 57 | \ No newline at end of file |
... | ... |
src/main/resources/mybatis/config/FilterConfigHeaderMapper.xml
... | ... | @@ -28,4 +28,15 @@ |
28 | 28 | created, createdBy, lastUpdated, lastUpdatedBy, version, userDef1, userDef2, userDef3, |
29 | 29 | userDef4, processStamp, filterName |
30 | 30 | </sql> |
31 | + | |
32 | + | |
33 | + <insert id="filterConfigHeaderCopy"> | |
34 | + insert into filter_config_header(moduleType, recordType, filterCode, warehouseCode, description, systemCreated, | |
35 | + createdBy, lastUpdatedBy, version, processStamp, filterName) | |
36 | + select moduleType, recordType, filterCode, #{newCode}, description, systemCreated, | |
37 | + createdBy, lastUpdatedBy, version, processStamp, filterName from filter_config_header | |
38 | + where warehouseCode = #{code} | |
39 | + | |
40 | + | |
41 | + </insert> | |
31 | 42 | </mapper> |
32 | 43 | \ No newline at end of file |
... | ... |
src/main/resources/mybatis/config/StatusFlowDetailMapper.xml
... | ... | @@ -33,4 +33,21 @@ |
33 | 33 | nessary, created, createdBy, lastUpdated, lastUpdatedBy, version, userDef1, userDef2, |
34 | 34 | userDef3, userDef4, userDef5, userDef6, userDef7, userDef8, processStamp |
35 | 35 | </sql> |
36 | + | |
37 | + <insert id="statusFlowDetailCopy"> | |
38 | + insert into status_flow_detail(headerId,headerCode, flowCode, warehouseCode, moduleType, recordType, `enable`, `sequence`, | |
39 | + nessary, createdBy, lastUpdatedBy, version, processStamp) | |
40 | + select headerId,headerCode, flowCode, #{newCode}, moduleType, recordType, `enable`, `sequence`, | |
41 | + nessary, createdBy, lastUpdatedBy, version,processStamp from status_flow_detail | |
42 | + where warehouseCode =#{code} | |
43 | + | |
44 | + </insert> | |
45 | + | |
46 | + <update id="updateHeaderId"> | |
47 | + update status_flow_detail d | |
48 | + inner join status_flow_header t | |
49 | + on t.code=d.headerCode and d.warehouseCode=t.warehouseCode and d.warehouseCode=#{code} | |
50 | + set d.headerId=t.id | |
51 | + | |
52 | + </update> | |
36 | 53 | </mapper> |
37 | 54 | \ No newline at end of file |
... | ... |
src/main/resources/mybatis/config/StatusFlowHeaderMapper.xml
... | ... | @@ -32,4 +32,11 @@ |
32 | 32 | lastUpdated, lastUpdatedBy, version, userDef1, userDef2, userDef3, userDef4, userDef5, |
33 | 33 | userDef6, userDef7, userDef8, processStamp, systemCreated |
34 | 34 | </sql> |
35 | + | |
36 | + | |
37 | + <insert id="statusFlowHeaderCopy"> | |
38 | + insert into status_flow_header(code,name,warehouseCode,moduleType,recordType,enable,createdBy,lastUpdatedBy,version,processStamp,systemCreated) | |
39 | + select code,name,#{newCode},moduleType,recordType,enable,createdBy, lastUpdatedBy,version,processStamp,systemCreated from status_flow_header | |
40 | + where warehouseCode = #{code} | |
41 | + </insert> | |
35 | 42 | </mapper> |
36 | 43 | \ No newline at end of file |
... | ... |
src/main/resources/mybatis/config/WaveFlowDetailMapper.xml
... | ... | @@ -31,4 +31,24 @@ |
31 | 31 | value1, value2, value3, value4, created, createdBy, lastUpdated, lastUpdatedBy, version, |
32 | 32 | userDef1, userDef2, userDef3, userDef4, processStamp |
33 | 33 | </sql> |
34 | + | |
35 | + | |
36 | + <insert id="waveFlowDetailCopy"> | |
37 | + insert into wave_flow_detail(headerId, waveFlowCode, warehouseCode, `sequence`, waveStepCode, waveStepName, | |
38 | + value1, value2, value3, value4, createdBy, lastUpdatedBy, version,processStamp) | |
39 | + select headerId, waveFlowCode, #{newCode}, `sequence`, waveStepCode, waveStepName, | |
40 | + value1, value2, value3, value4, createdBy, lastUpdatedBy, version, processStamp from wave_flow_detail | |
41 | + where warehouseCode =#{code} | |
42 | + | |
43 | + | |
44 | + </insert> | |
45 | + | |
46 | + <update id="updateHeaderId"> | |
47 | + update wave_flow_detail d | |
48 | + inner join wave_flow_header t | |
49 | + on t.code=d.waveFlowCode and d.warehouseCode=t.warehouseCode and d.warehouseCode=#{code} | |
50 | + set d.headerId=t.id | |
51 | + | |
52 | + </update> | |
53 | + | |
34 | 54 | </mapper> |
35 | 55 | \ No newline at end of file |
... | ... |
src/main/resources/mybatis/config/WaveFlowHeaderMapper.xml
... | ... | @@ -22,4 +22,12 @@ |
22 | 22 | id, code, warehouseCode, created, createdBy, lastUpdated, lastUpdatedBy, version, |
23 | 23 | userDef1, userDef2, userDef3, userDef4, processStamp |
24 | 24 | </sql> |
25 | + | |
26 | + | |
27 | + <insert id="waveFlowHeaderCopy"> | |
28 | + insert into wave_flow_header(code, warehouseCode, createdBy, lastUpdatedBy, version,processStamp) | |
29 | + select code, #{newCode}, createdBy, lastUpdatedBy, version,processStamp from wave_flow_header | |
30 | + where warehouseCode =#{code} | |
31 | + | |
32 | + </insert> | |
25 | 33 | </mapper> |
26 | 34 | \ No newline at end of file |
... | ... |
src/main/resources/mybatis/config/WaveMasterMapper.xml
... | ... | @@ -5,6 +5,7 @@ |
5 | 5 | <!--@mbg.generated--> |
6 | 6 | <id column="id" jdbcType="INTEGER" property="id" /> |
7 | 7 | <result column="code" jdbcType="VARCHAR" property="code" /> |
8 | + <result column="name" jdbcType="VARCHAR" property="name" /> | |
8 | 9 | <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" /> |
9 | 10 | <result column="sequence" jdbcType="INTEGER" property="sequence" /> |
10 | 11 | <result column="shipmentFilterCode" jdbcType="VARCHAR" property="shipmentFilterCode" /> |
... | ... | @@ -37,11 +38,24 @@ |
37 | 38 | </resultMap> |
38 | 39 | <sql id="Base_Column_List"> |
39 | 40 | <!--@mbg.generated--> |
40 | - id, code, warehouseCode, `sequence`, shipmentFilterCode, waveFlowCode, statusFlowCode, | |
41 | + id, code,name, warehouseCode, `sequence`, shipmentFilterCode, waveFlowCode, statusFlowCode, | |
41 | 42 | shortMode, maxShipments, maxLines, defaultWaveCreateSize, shipmentGroupSize, holdRplnTask, |
42 | 43 | rplnStrategy, rplnQtyUM, maxRplnQty, groupingOrderBy, assignmentRule, needReplenishment, |
43 | 44 | rplnAllocationRule, rplnLocatingRule, created, createdBy, lastUpdated, lastUpdatedBy, |
44 | 45 | version, userDef1, userDef2, userDef3, userDef4, |
45 | 46 | processStamp |
46 | 47 | </sql> |
48 | + | |
49 | + <insert id="waveMasterCopy"> | |
50 | + insert into wave_master(code,name, warehouseCode, `sequence`, shipmentFilterCode, waveFlowCode, statusFlowCode, | |
51 | + shortMode, maxShipments, maxLines, defaultWaveCreateSize, shipmentGroupSize, holdRplnTask, | |
52 | + rplnStrategy, rplnQtyUM, maxRplnQty, groupingOrderBy, assignmentRule, needReplenishment, | |
53 | + rplnAllocationRule, rplnLocatingRule, createdBy, lastUpdatedBy,version,processStamp) | |
54 | + select code,name,#{newCode}, `sequence`, shipmentFilterCode, waveFlowCode, statusFlowCode, | |
55 | + shortMode, maxShipments, maxLines, defaultWaveCreateSize, shipmentGroupSize, holdRplnTask, | |
56 | + rplnStrategy, rplnQtyUM, maxRplnQty, groupingOrderBy, assignmentRule, needReplenishment, | |
57 | + rplnAllocationRule, rplnLocatingRule, createdBy, lastUpdatedBy,version,processStamp from wave_master | |
58 | + where warehouseCode =#{code} | |
59 | + | |
60 | + </insert> | |
47 | 61 | </mapper> |
48 | 62 | \ No newline at end of file |
... | ... |
src/main/resources/mybatis/system/DictDataMapper.xml
... | ... | @@ -205,4 +205,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
205 | 205 | limit 1 |
206 | 206 | </select> |
207 | 207 | |
208 | + <insert id="dictDateCopy"> | |
209 | + insert into sys_dict_data(warehouseCode,dictSort,dictLabel,dictValue,dictType,cssClass,listClass,isDefault,enable,deleted,remark) | |
210 | + SELECT #{newCode},dictSort,dictLabel,dictValue,dictType,cssClass,listClass,isDefault,enable,deleted,remark from sys_dict_data | |
211 | + where warehouseCode = {code} | |
212 | + | |
213 | + </insert> | |
214 | + | |
215 | + <update id="updateHeaderId"> | |
216 | + update sys_dict_data d | |
217 | + inner join sys_dict_type t | |
218 | + on t.dictType=d.dictType and d.warehouseCode=t.warehouseCode and d.warehouseCode=#{code} | |
219 | + set d.headerId=t.id | |
220 | + </update> | |
221 | + | |
208 | 222 | </mapper> |
209 | 223 | \ No newline at end of file |
... | ... |
src/main/resources/mybatis/system/DictTypeMapper.xml
... | ... | @@ -141,5 +141,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
141 | 141 | ) |
142 | 142 | </foreach> |
143 | 143 | </insert> |
144 | + | |
145 | + <insert id="dictTypeCopy"> | |
146 | + insert into sys_dict_type(warehouseCode,dictName,dictType,enable,deleted,remark) | |
147 | + select #{newCode},dictName,dictType,enable,deleted,remark from sys_dict_type | |
148 | + where warehouseCode=#{code} | |
149 | + | |
150 | + </insert> | |
144 | 151 | |
145 | 152 | </mapper> |
146 | 153 | \ No newline at end of file |
... | ... |
src/main/resources/mybatis/system/MenuMapper.xml
... | ... | @@ -181,4 +181,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
181 | 181 | order by orderNum |
182 | 182 | </select> |
183 | 183 | |
184 | + <insert id="menuCopy"> | |
185 | + insert into sys_menu(menuName,parentId,parentName,orderNum,url,menuType,menuMobile,visible,perms,icon,warehouseCode,remark) | |
186 | + select menuName,parentId,parentName,orderNum,url,menuType,menuMobile,visible,perms,icon,#{newCode},remark from sys_menu | |
187 | + where warehouseCode = #{code} | |
188 | + | |
189 | + </insert> | |
190 | + | |
191 | + <update id="updateParentId"> | |
192 | + update sys_menu s | |
193 | + inner join sys_menu m on s.warehouseCode=#{code} and s.parentName=m.menuName set s.parentId=m.id | |
194 | + | |
195 | + </update> | |
196 | + | |
184 | 197 | </mapper> |
185 | 198 | \ No newline at end of file |
... | ... |
src/main/resources/mybatis/system/RoleMapper.xml
... | ... | @@ -124,5 +124,10 @@ |
124 | 124 | sysdate() |
125 | 125 | ) |
126 | 126 | </insert> |
127 | + | |
128 | + <insert id="roleCopy"> | |
129 | + insert into sys_role(roleName,roleCode,roleSort,warehouseCode,enable,remark) | |
130 | + select roleName,roleCode,roleSort,#{newCode},enable,remark from sys_role where warehouseCode=#{code} | |
131 | + </insert> | |
127 | 132 | |
128 | 133 | </mapper> |
129 | 134 | \ No newline at end of file |
... | ... |
src/main/resources/templates/config/shipmentType/add.html
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | <head th:include="include :: header"></head> |
5 | 5 | <body class="white-bg"> |
6 | 6 | <div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
7 | - <form class="form-horizontal m" id="form-receiptType-add"> | |
7 | + <form class="form-horizontal m" id="form-shipmentType-add"> | |
8 | 8 | <div class="form-group"> |
9 | 9 | <label class="col-sm-3 control-label">编码:</label> |
10 | 10 | <div class="col-sm-8"> |
... | ... | @@ -46,7 +46,7 @@ |
46 | 46 | <div class="form-group"> |
47 | 47 | <label class="col-sm-3 control-label">出库流程:</label> |
48 | 48 | <div class="col-sm-8"> |
49 | - <select id="receiptFlow" name="shipmentFlow" class="form-control" th:with="statusFlowList=${@StatusFlow.flowList()}"> | |
49 | + <select id="shipmentFlow" name="shipmentFlow" class="form-control" th:with="statusFlowList=${@StatusFlow.flowList('shippingFlow')}"> | |
50 | 50 | <option th:each="flow : ${statusFlowList}" th:text="${flow['name']}" th:value="${flow['code']}"></option> |
51 | 51 | </select> |
52 | 52 | </div> |
... | ... | @@ -153,7 +153,7 @@ |
153 | 153 | <div th:include="include::footer"></div> |
154 | 154 | <script type="text/javascript"> |
155 | 155 | var prefix = ctx + "config/shipmentType"; |
156 | - $("#form-receiptType-add").validate({ | |
156 | + $("#form-shipmentType-add").validate({ | |
157 | 157 | rules:{ |
158 | 158 | code:{ |
159 | 159 | required:true, |
... | ... | @@ -167,7 +167,7 @@ |
167 | 167 | }, |
168 | 168 | submitHandler: function(form) { |
169 | 169 | // $.operate.save(prefix + "/add", $('#form-locationType-add').serialize()); |
170 | - var tableValue = $.common.getTableValue("#form-receiptType-add"); | |
170 | + var tableValue = $.common.getTableValue("#form-shipmentType-add"); | |
171 | 171 | tableValue = formValueReplace(tableValue, "companyCode", $("#companyCode option:selected").val()); |
172 | 172 | tableValue = formValueReplace(tableValue, "shipmentFlow", $("#shipmentFlow option:selected").val()); |
173 | 173 | tableValue = formValueReplace(tableValue, "enable", $("input[name='enable']").is(':checked')); |
... | ... |
src/main/resources/templates/config/shipmentType/edit.html
... | ... | @@ -155,7 +155,7 @@ |
155 | 155 | <div th:include="include::footer"></div> |
156 | 156 | <script type="text/javascript"> |
157 | 157 | var prefix = ctx + "config/shipmentType"; |
158 | - $("#form-receiptType-edit").validate({ | |
158 | + $("#form-shipmentType-edit").validate({ | |
159 | 159 | rules:{ |
160 | 160 | code:{ |
161 | 161 | required:true, |
... | ... |