Commit 6a4b79540d70e3309013c2f65de8282ea81cced1
Merge remote-tracking branch 'origin/develop' into develop
Showing
15 changed files
with
237 additions
and
91 deletions
src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/controller/ReceiptContainerDetailController.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
4 | import com.baomidou.mybatisplus.core.metadata.IPage; | 4 | import com.baomidou.mybatisplus.core.metadata.IPage; |
5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
7 | +import com.huaheng.common.exception.service.ServiceException; | ||
7 | import com.huaheng.common.support.Convert; | 8 | import com.huaheng.common.support.Convert; |
8 | import com.huaheng.common.utils.StringUtils; | 9 | import com.huaheng.common.utils.StringUtils; |
9 | import com.huaheng.framework.aspectj.lang.annotation.Log; | 10 | import com.huaheng.framework.aspectj.lang.annotation.Log; |
@@ -13,6 +14,8 @@ import com.huaheng.framework.web.domain.AjaxResult; | @@ -13,6 +14,8 @@ import com.huaheng.framework.web.domain.AjaxResult; | ||
13 | import com.huaheng.framework.web.page.PageDomain; | 14 | import com.huaheng.framework.web.page.PageDomain; |
14 | import com.huaheng.framework.web.page.TableDataInfo; | 15 | import com.huaheng.framework.web.page.TableDataInfo; |
15 | import com.huaheng.framework.web.page.TableSupport; | 16 | import com.huaheng.framework.web.page.TableSupport; |
17 | +import com.huaheng.pc.config.company.domain.Company; | ||
18 | +import com.huaheng.pc.config.company.service.CompanyService; | ||
16 | import com.huaheng.pc.receipt.receiptContainerDetail.domain.ReceiptContainerDetail; | 19 | import com.huaheng.pc.receipt.receiptContainerDetail.domain.ReceiptContainerDetail; |
17 | import com.huaheng.pc.receipt.receiptContainerDetail.service.ReceiptContainerDetailService; | 20 | import com.huaheng.pc.receipt.receiptContainerDetail.service.ReceiptContainerDetailService; |
18 | import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader; | 21 | import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader; |
@@ -20,13 +23,16 @@ import com.huaheng.pc.receipt.receiptDetail.domain.ReceiptDetail; | @@ -20,13 +23,16 @@ import com.huaheng.pc.receipt.receiptDetail.domain.ReceiptDetail; | ||
20 | import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader; | 23 | import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader; |
21 | import io.swagger.annotations.ApiOperation; | 24 | import io.swagger.annotations.ApiOperation; |
22 | import io.swagger.annotations.ApiParam; | 25 | import io.swagger.annotations.ApiParam; |
26 | +import org.apache.commons.lang3.time.DateFormatUtils; | ||
23 | import org.apache.shiro.authz.annotation.RequiresPermissions; | 27 | import org.apache.shiro.authz.annotation.RequiresPermissions; |
24 | import org.springframework.stereotype.Controller; | 28 | import org.springframework.stereotype.Controller; |
25 | import org.springframework.ui.ModelMap; | 29 | import org.springframework.ui.ModelMap; |
26 | import org.springframework.web.bind.annotation.*; | 30 | import org.springframework.web.bind.annotation.*; |
27 | 31 | ||
28 | import javax.annotation.Resource; | 32 | import javax.annotation.Resource; |
33 | +import java.util.ArrayList; | ||
29 | import java.util.Arrays; | 34 | import java.util.Arrays; |
35 | +import java.util.Date; | ||
30 | import java.util.List; | 36 | import java.util.List; |
31 | 37 | ||
32 | @Controller | 38 | @Controller |
@@ -35,6 +41,8 @@ public class ReceiptContainerDetailController extends BaseController { | @@ -35,6 +41,8 @@ public class ReceiptContainerDetailController extends BaseController { | ||
35 | 41 | ||
36 | @Resource | 42 | @Resource |
37 | private ReceiptContainerDetailService receiptContainerDetailService; | 43 | private ReceiptContainerDetailService receiptContainerDetailService; |
44 | + @Resource | ||
45 | + private CompanyService companyService; | ||
38 | 46 | ||
39 | private String prefix = "receipt/receiptContainerDetail"; | 47 | private String prefix = "receipt/receiptContainerDetail"; |
40 | 48 | ||
@@ -115,4 +123,31 @@ public class ReceiptContainerDetailController extends BaseController { | @@ -115,4 +123,31 @@ public class ReceiptContainerDetailController extends BaseController { | ||
115 | List<Integer> idList = Arrays.asList(Convert.toIntArray(ids)); | 123 | List<Integer> idList = Arrays.asList(Convert.toIntArray(ids)); |
116 | return toAjax(receiptContainerDetailService.detailRemove(idList)); | 124 | return toAjax(receiptContainerDetailService.detailRemove(idList)); |
117 | } | 125 | } |
126 | + | ||
127 | + @RequiresPermissions("shipment:bill:report") | ||
128 | + @Log(title = "入库-入库单", operating = "打印入库单明细报表", action = BusinessType.OTHER) | ||
129 | + @GetMapping("/reportBatteryPackage/{ids}") | ||
130 | + public String reportBatteryPackage(@PathVariable("ids") Integer[] ids, ModelMap mmap) { | ||
131 | + List<ReceiptContainerDetail> list = new ArrayList<ReceiptContainerDetail>(); | ||
132 | + for (Integer id : ids) { | ||
133 | + if (id != null) { | ||
134 | + ReceiptContainerDetail receiptDetail = receiptContainerDetailService.getById(id); | ||
135 | + if(StringUtils.isEmpty(receiptDetail.getBatteryPackTwoCode())){ | ||
136 | + continue; | ||
137 | + //throw new ServiceException("系统没有此电池包信息" + receiptDetail.getBatteryPackTwoCode()); | ||
138 | + } | ||
139 | + LambdaQueryWrapper<Company> companyLambda = Wrappers.lambdaQuery(); | ||
140 | + companyLambda.eq(Company::getCode, receiptDetail.getCompanyCode()); | ||
141 | + Company company = companyService.getOne(companyLambda); | ||
142 | + if (company == null) { | ||
143 | + throw new ServiceException("系统没有此货主编码" + receiptDetail.getCompanyCode()); | ||
144 | + } | ||
145 | + receiptDetail.setCompanyName(company.getName()); | ||
146 | + receiptDetail.setUserDef1(DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); | ||
147 | + list.add(receiptDetail); | ||
148 | + } | ||
149 | + mmap.put("receiptDetails", list); | ||
150 | + } | ||
151 | + return prefix + "/reportBatteryPackage"; | ||
152 | + } | ||
118 | } | 153 | } |
src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/domain/ReceiptContainerDetail.java
@@ -482,5 +482,10 @@ public class ReceiptContainerDetail implements Serializable { | @@ -482,5 +482,10 @@ public class ReceiptContainerDetail implements Serializable { | ||
482 | @ApiModelProperty(value="回收人") | 482 | @ApiModelProperty(value="回收人") |
483 | private String recycler; | 483 | private String recycler; |
484 | 484 | ||
485 | + | ||
486 | + @TableField(exist = false) | ||
487 | + @ApiModelProperty(value = "货主名称") | ||
488 | + private String companyName; | ||
489 | + | ||
485 | private static final long serialVersionUID = 1L; | 490 | private static final long serialVersionUID = 1L; |
486 | } | 491 | } |
487 | \ No newline at end of file | 492 | \ No newline at end of file |
src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/service/ReceiptContainerDetailService.java
@@ -15,7 +15,7 @@ public interface ReceiptContainerDetailService extends IService<ReceiptContainer | @@ -15,7 +15,7 @@ public interface ReceiptContainerDetailService extends IService<ReceiptContainer | ||
15 | * @param receiptCode 入库单编码 | 15 | * @param receiptCode 入库单编码 |
16 | * @return AjaxResult | 16 | * @return AjaxResult |
17 | */ | 17 | */ |
18 | - AjaxResult<List<Map<String, Object>>> getReceiptInfoByBill(String receiptCode); | 18 | + AjaxResult<List<ReceiptContainerDetail>> getReceiptInfoByBill(String receiptCode); |
19 | 19 | ||
20 | /** | 20 | /** |
21 | * 撤销入库组盘明细 | 21 | * 撤销入库组盘明细 |
src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/service/ReceiptContainerDetailServiceImpl.java
@@ -64,12 +64,12 @@ public class ReceiptContainerDetailServiceImpl extends ServiceImpl<ReceiptContai | @@ -64,12 +64,12 @@ public class ReceiptContainerDetailServiceImpl extends ServiceImpl<ReceiptContai | ||
64 | * @return AjaxResult | 64 | * @return AjaxResult |
65 | */ | 65 | */ |
66 | @Override | 66 | @Override |
67 | - public AjaxResult<List<Map<String, Object>>> getReceiptInfoByBill(String receiptCode) { | 67 | + public AjaxResult<List<ReceiptContainerDetail>> getReceiptInfoByBill(String receiptCode) { |
68 | LambdaQueryWrapper<ReceiptContainerDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); | 68 | LambdaQueryWrapper<ReceiptContainerDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
69 | lambdaQueryWrapper.eq(ReceiptContainerDetail::getReceiptCode, receiptCode) | 69 | lambdaQueryWrapper.eq(ReceiptContainerDetail::getReceiptCode, receiptCode) |
70 | .eq(ReceiptContainerDetail::getWarehouseCode, ShiroUtils.getWarehouseCode()); | 70 | .eq(ReceiptContainerDetail::getWarehouseCode, ShiroUtils.getWarehouseCode()); |
71 | 71 | ||
72 | - List<Map<String, Object>> detail = this.listMaps(lambdaQueryWrapper); | 72 | + List<ReceiptContainerDetail> detail = this.list(lambdaQueryWrapper); |
73 | return AjaxResult.success(detail); | 73 | return AjaxResult.success(detail); |
74 | } | 74 | } |
75 | 75 |
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderServiceImpl.java
@@ -7,6 +7,7 @@ import com.huaheng.api.wcs.domain.WcsTask; | @@ -7,6 +7,7 @@ import com.huaheng.api.wcs.domain.WcsTask; | ||
7 | import com.huaheng.api.wcs.service.warecellAllocation.WarecellAllocationService; | 7 | import com.huaheng.api.wcs.service.warecellAllocation.WarecellAllocationService; |
8 | import com.huaheng.common.constant.QuantityConstant; | 8 | import com.huaheng.common.constant.QuantityConstant; |
9 | import com.huaheng.common.exception.service.ServiceException; | 9 | import com.huaheng.common.exception.service.ServiceException; |
10 | +import com.huaheng.common.utils.DataUtils; | ||
10 | import com.huaheng.common.utils.StringUtils; | 11 | import com.huaheng.common.utils.StringUtils; |
11 | import com.huaheng.common.utils.bean.BeanUtils; | 12 | import com.huaheng.common.utils.bean.BeanUtils; |
12 | import com.huaheng.common.utils.security.ShiroUtils; | 13 | import com.huaheng.common.utils.security.ShiroUtils; |
@@ -347,9 +348,34 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai | @@ -347,9 +348,34 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai | ||
347 | receiptDetailsave.setMaterialGrossWeight(materialGrossWeight); | 348 | receiptDetailsave.setMaterialGrossWeight(materialGrossWeight); |
348 | receiptDetailsave.setMaterialNetWeight(materialNetWeight); | 349 | receiptDetailsave.setMaterialNetWeight(materialNetWeight); |
349 | receiptDetailsave.setMaterialTareWeight(materialTareWeight); | 350 | receiptDetailsave.setMaterialTareWeight(materialTareWeight); |
351 | + //电池类才生成电池包二维码 | ||
352 | + String batteryPackTwoCode=findBatteryPackTwoCode(receiptDetailsave); | ||
353 | + receiptDetailsave.setBatteryPackTwoCode(batteryPackTwoCode); | ||
354 | + | ||
350 | receiptDetailService.updateById(receiptDetailsave); | 355 | receiptDetailService.updateById(receiptDetailsave); |
351 | } | 356 | } |
352 | 357 | ||
358 | + public String findBatteryPackTwoCode(ReceiptDetail receiptDetail){ | ||
359 | + String batteryPackTwoCode=null; | ||
360 | + if(receiptDetail.getMaterialIsBattery()==1){ | ||
361 | + LambdaQueryWrapper<ReceiptContainerDetail> receiptDetailWrapper1 = Wrappers.lambdaQuery(); | ||
362 | + //receiptDetailWrapper1.eq(StringUtils.isNotEmpty(receiptDetail.getBatteryPackType()),ReceiptContainerDetail::getBatteryPackType, receiptDetail.getBatteryPackType()); | ||
363 | + // receiptDetailWrapper1.eq(StringUtils.isEmpty(receiptDetail.getBatteryPackType()),ReceiptDetail::getBatteryPackType, "P1"); | ||
364 | + receiptDetailWrapper1.orderByDesc(ReceiptContainerDetail::getBatteryPackTwoCode).last("Limit 1"); | ||
365 | + ReceiptContainerDetail detail1=receiptContainerDetailService.getOne(receiptDetailWrapper1); | ||
366 | + String maxCode="0"; | ||
367 | + if(null!=detail1){ | ||
368 | + maxCode=detail1.getBatteryPackTwoCode(); | ||
369 | + } | ||
370 | + batteryPackTwoCode= DataUtils.createSerialNumber(receiptDetail.getBatteryPackType(),maxCode,1); | ||
371 | + /*if(StringUtils.isNotEmpty(receiptDetail.getBatteryPackType())){ | ||
372 | + }else{ | ||
373 | + batteryPackTwoCode= DataUtils.createSerialNumber("P1",maxCode,1); | ||
374 | + }*/ | ||
375 | + return batteryPackTwoCode; | ||
376 | + } | ||
377 | + return batteryPackTwoCode; | ||
378 | + } | ||
353 | //成品入库组盘校验 | 379 | //成品入库组盘校验 |
354 | public void checkReciptContainer(String barCodeHeaderId){ | 380 | public void checkReciptContainer(String barCodeHeaderId){ |
355 | BarCodeHeader barCodeHeader = barCodeHeaderService.getById(barCodeHeaderId); | 381 | BarCodeHeader barCodeHeader = barCodeHeaderService.getById(barCodeHeaderId); |
src/main/java/com/huaheng/pc/receipt/receiptDetail/controller/ReceiptDetailController.java
@@ -318,31 +318,7 @@ public class ReceiptDetailController extends BaseController { | @@ -318,31 +318,7 @@ public class ReceiptDetailController extends BaseController { | ||
318 | return prefix + "/report"; | 318 | return prefix + "/report"; |
319 | } | 319 | } |
320 | 320 | ||
321 | - @RequiresPermissions("shipment:bill:report") | ||
322 | - @Log(title = "入库-入库单", operating = "打印入库单明细报表", action = BusinessType.OTHER) | ||
323 | - @GetMapping("/reportBatteryPackage/{ids}") | ||
324 | - public String reportBatteryPackage(@PathVariable("ids") Integer[] ids, ModelMap mmap) { | ||
325 | - List<ReceiptDetail> list = new ArrayList<ReceiptDetail>(); | ||
326 | - for (Integer id : ids) { | ||
327 | - if (id != null) { | ||
328 | - ReceiptDetail receiptDetail = receiptDetailService.getById(id); | ||
329 | - if(StringUtils.isEmpty(receiptDetail.getBatteryPackTwoCode())){ | ||
330 | - throw new ServiceException("系统没有此电池包信息" + receiptDetail.getBatteryPackageCode()); | ||
331 | - } | ||
332 | - LambdaQueryWrapper<Company> companyLambda = Wrappers.lambdaQuery(); | ||
333 | - companyLambda.eq(Company::getCode, receiptDetail.getCompanyCode()); | ||
334 | - Company company = companyService.getOne(companyLambda); | ||
335 | - if (company == null) { | ||
336 | - throw new ServiceException("系统没有此货主编码" + receiptDetail.getCompanyCode()); | ||
337 | - } | ||
338 | - receiptDetail.setCompanyName(company.getName()); | ||
339 | - receiptDetail.setUserDef1(DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); | ||
340 | - list.add(receiptDetail); | ||
341 | - } | ||
342 | - mmap.put("receiptDetails", list); | ||
343 | - } | ||
344 | - return prefix + "/reportBatteryPackage"; | ||
345 | - } | 321 | + |
346 | 322 | ||
347 | /** | 323 | /** |
348 | * 上传请求 | 324 | * 上传请求 |
src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailService.java
@@ -66,4 +66,6 @@ public interface ReceiptDetailService extends IService<ReceiptDetail>{ | @@ -66,4 +66,6 @@ public interface ReceiptDetailService extends IService<ReceiptDetail>{ | ||
66 | * @return | 66 | * @return |
67 | */ | 67 | */ |
68 | List<ReceiptDetail> findByReceiptId(Integer id); | 68 | List<ReceiptDetail> findByReceiptId(Integer id); |
69 | + //生成电池包二维码 | ||
70 | + String findBatteryPackTwoCode(ReceiptDetail receiptDetail); | ||
69 | } | 71 | } |
src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java
@@ -116,22 +116,10 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R | @@ -116,22 +116,10 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R | ||
116 | } else if (receiptHeader.getFirstStatus() == 20) { | 116 | } else if (receiptHeader.getFirstStatus() == 20) { |
117 | throw new ServiceException("单据已作废"); | 117 | throw new ServiceException("单据已作废"); |
118 | } | 118 | } |
119 | - receiptDetail.setReceiptCode(receiptHeader.getCode()); | ||
120 | - | ||
121 | 119 | ||
122 | -// LambdaQueryWrapper<ReceiptDetail> receiptDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | ||
123 | -// receiptDetailLambdaQueryWrapper.eq(StringUtils.isNotEmpty(receiptDetail.getBatteryCode()),ReceiptDetail::getBatteryCode,receiptDetail.getBatteryCode()); | ||
124 | -// List<ReceiptDetail> receiptDetails = receiptDetailSerivece.list(receiptDetailLambdaQueryWrapper); | ||
125 | -// if(receiptDetails.size()>0){ | ||
126 | -// return AjaxResult.error("电池编码不能重复"); | ||
127 | -// } | 120 | + //receiptContainerDetailAdd |
121 | + receiptDetail.setReceiptCode(receiptHeader.getCode()); | ||
128 | 122 | ||
129 | - /*if(StringUtils.isNotNull(receiptDetail.getReceiptWeight())){ | ||
130 | - double receiptWeightDouble = receiptDetail.getReceiptWeight().doubleValue(); | ||
131 | - if(!(receiptWeightDouble > 0 && receiptWeightDouble < 99999)){ | ||
132 | - return AjaxResult.error("入库质量 数值必须大于 0,小于 99999"); | ||
133 | - } | ||
134 | - }*/ | ||
135 | 123 | ||
136 | /* 判断物料编码*/ | 124 | /* 判断物料编码*/ |
137 | LambdaQueryWrapper<Material> lambdaQueryWrapper = Wrappers.lambdaQuery(); | 125 | LambdaQueryWrapper<Material> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
@@ -142,9 +130,6 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R | @@ -142,9 +130,6 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R | ||
142 | throw new ServiceException("物料不存在"); | 130 | throw new ServiceException("物料不存在"); |
143 | } | 131 | } |
144 | //生成电池包二维码 | 132 | //生成电池包二维码 |
145 | - | ||
146 | - | ||
147 | - | ||
148 | receiptDetail.setCompanyCode(receiptHeader.getCompanyCode()); | 133 | receiptDetail.setCompanyCode(receiptHeader.getCompanyCode()); |
149 | receiptDetail.setMaterialCode(material.getCode()); | 134 | receiptDetail.setMaterialCode(material.getCode()); |
150 | receiptDetail.setMaterialName(material.getName()); | 135 | receiptDetail.setMaterialName(material.getName()); |
@@ -159,35 +144,30 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R | @@ -159,35 +144,30 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R | ||
159 | String poundCode=findPoundCode(receiptDetail); | 144 | String poundCode=findPoundCode(receiptDetail); |
160 | receiptDetail.setPoundCode(poundCode); | 145 | receiptDetail.setPoundCode(poundCode); |
161 | 146 | ||
162 | - receiptDetail.setUnitId1(receiptDetail.getUnitId1()); | ||
163 | - receiptDetail.setUnitId2(receiptDetail.getUnitId2()); | ||
164 | - receiptDetail.setUnitId1Qty(receiptDetail.getUnitId1Qty()); | ||
165 | - receiptDetail.setUnitId1Qty(receiptDetail.getUnitId2Qty()); | ||
166 | - receiptDetail.setMultiple(receiptDetail.getMultiple()); | 147 | +// receiptDetail.setUnitId1(receiptDetail.getUnitId1()); |
148 | +// receiptDetail.setUnitId2(receiptDetail.getUnitId2()); | ||
149 | +// receiptDetail.setUnitId1Qty(receiptDetail.getUnitId1Qty()); | ||
150 | +// receiptDetail.setUnitId1Qty(receiptDetail.getUnitId2Qty()); | ||
151 | +// receiptDetail.setMultiple(receiptDetail.getMultiple()); | ||
167 | receiptDetail.setCreatedBy(ShiroUtils.getLoginName()); | 152 | receiptDetail.setCreatedBy(ShiroUtils.getLoginName()); |
168 | receiptDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); | 153 | receiptDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); |
169 | receiptDetail.setWarehouseCode(ShiroUtils.getWarehouseCode()); | 154 | receiptDetail.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
170 | - receiptDetail.setTotalWeight(receiptDetail.getTotalWeight()); | ||
171 | - receiptDetail.setVin(receiptDetail.getVin()); | ||
172 | - receiptDetail.setScrapTime(receiptDetail.getScrapTime()); | ||
173 | - //receiptDetail.setReceiptWeight(receiptDetail.getReceiptWeight()); | ||
174 | - receiptDetail.setElectricQuantity(receiptDetail.getElectricQuantity()); | ||
175 | - receiptDetail.setBatteryPackageWeight(receiptDetail.getBatteryPackageWeight()); | ||
176 | - //04-28 | ||
177 | - receiptDetail.setMaterialNetWeight(receiptDetail.getMaterialNetWeight()); | ||
178 | - receiptDetail.setMaterialTareWeight(receiptDetail.getMaterialTareWeight()); | ||
179 | - receiptDetail.setMaterialGrossWeight(receiptDetail.getMaterialGrossWeight()); | ||
180 | -// receiptDetail.setBatteryPackageCode(receiptDetail.getBatteryPackageCode()); | ||
181 | - receiptDetail.setMaterialBatch(receiptDetail.getMaterialBatch()); | 155 | +// receiptDetail.setTotalWeight(receiptDetail.getTotalWeight()); |
156 | +// receiptDetail.setVin(receiptDetail.getVin()); | ||
157 | +// receiptDetail.setScrapTime(receiptDetail.getScrapTime()); | ||
158 | +// receiptDetail.setElectricQuantity(receiptDetail.getElectricQuantity()); | ||
159 | +// receiptDetail.setBatteryPackageWeight(receiptDetail.getBatteryPackageWeight()); | ||
160 | +// //04-28 | ||
161 | +// receiptDetail.setMaterialNetWeight(receiptDetail.getMaterialNetWeight()); | ||
162 | +// receiptDetail.setMaterialTareWeight(receiptDetail.getMaterialTareWeight()); | ||
163 | +// receiptDetail.setMaterialGrossWeight(receiptDetail.getMaterialGrossWeight()); | ||
164 | +// receiptDetail.setMaterialBatch(receiptDetail.getMaterialBatch()); | ||
182 | 165 | ||
183 | 166 | ||
184 | //根据流程配置更新入库明细下一流程 | 167 | //根据流程配置更新入库明细下一流程 |
185 | ReceiptDetail receiptDetail1 = queryflow(receiptDetail); | 168 | ReceiptDetail receiptDetail1 = queryflow(receiptDetail); |
186 | 169 | ||
187 | if (this.save(receiptDetail1)) { | 170 | if (this.save(receiptDetail1)) { |
188 | -// receiptHeader.setTotalQty(receiptHeader.getTotalQty().add(receiptDetail1.getTotalQty())); | ||
189 | -// receiptHeader.setTotalLines(receiptHeader.getTotalLines()+1); | ||
190 | -// receiptHeaderService.updateById(receiptHeader); | ||
191 | updateReceiptHeader(receiptHeader); | 171 | updateReceiptHeader(receiptHeader); |
192 | return AjaxResult.success("新增单据明细成功"); | 172 | return AjaxResult.success("新增单据明细成功"); |
193 | } else { | 173 | } else { |
@@ -195,7 +175,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R | @@ -195,7 +175,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R | ||
195 | } | 175 | } |
196 | 176 | ||
197 | } | 177 | } |
198 | - | 178 | + @Override |
199 | public String findBatteryPackTwoCode(ReceiptDetail receiptDetail){ | 179 | public String findBatteryPackTwoCode(ReceiptDetail receiptDetail){ |
200 | String batteryPackTwoCode=null; | 180 | String batteryPackTwoCode=null; |
201 | if(receiptDetail.getMaterialIsBattery()==1){ | 181 | if(receiptDetail.getMaterialIsBattery()==1){ |
src/main/java/com/huaheng/pc/shipment/shipmentContainerDetail/domain/ShipmentContainerDetail.java
@@ -399,6 +399,13 @@ public class ShipmentContainerDetail implements Serializable { | @@ -399,6 +399,13 @@ public class ShipmentContainerDetail implements Serializable { | ||
399 | @ApiModelProperty(value="是否电池,1电池,2非电池") | 399 | @ApiModelProperty(value="是否电池,1电池,2非电池") |
400 | private Integer materialIsBattery; | 400 | private Integer materialIsBattery; |
401 | 401 | ||
402 | + /** | ||
403 | + * 电池包二维码 | ||
404 | + */ | ||
405 | + @TableField(value = "batteryPackTwoCode") | ||
406 | + @ApiModelProperty(value="电池包二维码") | ||
407 | + private String batteryPackTwoCode; | ||
408 | + | ||
402 | 409 | ||
403 | private static final long serialVersionUID = 1L; | 410 | private static final long serialVersionUID = 1L; |
404 | } | 411 | } |
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java
@@ -183,14 +183,6 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | @@ -183,14 +183,6 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | ||
183 | }else if(i < 0) { | 183 | }else if(i < 0) { |
184 | throw new ServiceException("出库数量不能大于单据数量!"); | 184 | throw new ServiceException("出库数量不能大于单据数量!"); |
185 | } | 185 | } |
186 | -// int u = shipmentDetail.getShipWeight().compareTo(shipmentDetail.getRequestWeight()); | ||
187 | -// if(u > 0){ | ||
188 | -// shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_WAVE); | ||
189 | -// }else if(u == 0) { | ||
190 | -// shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_GROUPDISK); | ||
191 | -// }else if(u < 0) { | ||
192 | -// throw new ServiceException("出库数量不能大于单据数量!"); | ||
193 | -// } | ||
194 | shipmentDetailService.saveOrUpdate(shipmentDetail); | 186 | shipmentDetailService.saveOrUpdate(shipmentDetail); |
195 | 187 | ||
196 | 188 | ||
@@ -423,6 +415,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | @@ -423,6 +415,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | ||
423 | shipmentContainerDetaill.setMaterialTareWeight(inventoryDetail.getMaterialTareWeight()); | 415 | shipmentContainerDetaill.setMaterialTareWeight(inventoryDetail.getMaterialTareWeight()); |
424 | shipmentContainerDetaill.setMaterialNetWeight(inventoryDetail.getMaterialNetWeight()); | 416 | shipmentContainerDetaill.setMaterialNetWeight(inventoryDetail.getMaterialNetWeight()); |
425 | shipmentContainerDetaill.setMaterialGrossWeight(inventoryDetail.getMaterialGrossWeight()); | 417 | shipmentContainerDetaill.setMaterialGrossWeight(inventoryDetail.getMaterialGrossWeight()); |
418 | + shipmentContainerDetaill.setBatteryPackTwoCode(inventoryDetail.getBatteryPackTwoCode()); | ||
426 | shipmentContainerDetaill.setQty(qty); | 419 | shipmentContainerDetaill.setQty(qty); |
427 | shipmentContainerDetaill.setWeights(new BigDecimal(0)); | 420 | shipmentContainerDetaill.setWeights(new BigDecimal(0)); |
428 | shipmentContainerDetaill.setElectricQuantity(shipmentCombinationModel.getElectricQuantity()); | 421 | shipmentContainerDetaill.setElectricQuantity(shipmentCombinationModel.getElectricQuantity()); |
src/main/resources/mybatis/receipt/ReceiptContainerDetailMapper.xml
@@ -77,5 +77,6 @@ | @@ -77,5 +77,6 @@ | ||
77 | inventorySts, taskCreated, convertedQty, convertedQtyUnit, created, createdBy, lastUpdated, | 77 | inventorySts, taskCreated, convertedQty, convertedQtyUnit, created, createdBy, lastUpdated, |
78 | lastUpdatedBy, version, userDef1, userDef2, userDef3, userDef4, userDef5, userDef6, | 78 | lastUpdatedBy, version, userDef1, userDef2, userDef3, userDef4, userDef5, userDef6, |
79 | userDef7, userDef8, processStamp,materialNetWeight,materialTareWeight,materialGrossWeight | 79 | userDef7, userDef8, processStamp,materialNetWeight,materialTareWeight,materialGrossWeight |
80 | + ,batteryQty,batteryPackType,batteryTypes,completeness,batteryPackTwoCode,materialIsBattery,recycler | ||
80 | </sql> | 81 | </sql> |
81 | </mapper> | 82 | </mapper> |
82 | \ No newline at end of file | 83 | \ No newline at end of file |
src/main/resources/mybatis/shipment/ShipmentContainerDetailMapper.xml
@@ -82,6 +82,7 @@ | @@ -82,6 +82,7 @@ | ||
82 | <result column="materialTareWeight" jdbcType="DECIMAL" property="materialTareWeight" /> | 82 | <result column="materialTareWeight" jdbcType="DECIMAL" property="materialTareWeight" /> |
83 | <result column="materialGrossWeight" jdbcType="DECIMAL" property="materialGrossWeight" /> | 83 | <result column="materialGrossWeight" jdbcType="DECIMAL" property="materialGrossWeight" /> |
84 | <result column="materialIsBattery" jdbcType="INTEGER" property="materialIsBattery" /> | 84 | <result column="materialIsBattery" jdbcType="INTEGER" property="materialIsBattery" /> |
85 | + <result column="batteryPackTwoCode" jdbcType="VARCHAR" property="batteryPackTwoCode" /> | ||
85 | </resultMap> | 86 | </resultMap> |
86 | <sql id="Base_Column_List"> | 87 | <sql id="Base_Column_List"> |
87 | <!--@mbg.generated--> | 88 | <!--@mbg.generated--> |
@@ -96,7 +97,7 @@ | @@ -96,7 +97,7 @@ | ||
96 | attribute4, batch, lot, projectNo, manufactureDate, expirationDate, agingDate, inventorySts, | 97 | attribute4, batch, lot, projectNo, manufactureDate, expirationDate, agingDate, inventorySts, |
97 | packingClass, created, createdBy, lastUpdated, lastUpdatedBy, | 98 | packingClass, created, createdBy, lastUpdated, lastUpdatedBy, |
98 | version, userDef1, userDef2, userDef3, | 99 | version, userDef1, userDef2, userDef3, |
99 | - processStamp,materialNetWeight,materialTareWeight,materialGrossWeight | 100 | + processStamp,materialNetWeight,materialTareWeight,materialGrossWeight,batteryPackTwoCode |
100 | </sql> | 101 | </sql> |
101 | 102 | ||
102 | <select id="selectListMapByEqual" resultType="java.util.HashMap"> | 103 | <select id="selectListMapByEqual" resultType="java.util.HashMap"> |
src/main/resources/templates/receipt/receiptContainerDetail/reportBatteryPackage.html
0 → 100644
1 | +<!DOCTYPE HTML> | ||
2 | +<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> | ||
3 | +<meta charset="utf-8"> | ||
4 | +<head th:include="include :: header"></head> | ||
5 | +<style> | ||
6 | + .divstyle{ | ||
7 | + margin-top: 0px; | ||
8 | + } | ||
9 | + .spanstyle{ | ||
10 | + margin-left: 2%; | ||
11 | + } | ||
12 | + .dy-report{ | ||
13 | + | ||
14 | + } | ||
15 | +</style> | ||
16 | +<body class="white-bg" style="padding:5px 0;" id="ddd"> | ||
17 | +<div class="container" style="color: #333;"> | ||
18 | + <div class="row"> | ||
19 | + <div class="row" style="text-align:right"><span class="hidden-print" style="padding-left:2px;"><button type="button" onClick="a()"><i class="fa fa-print"></i> 打印</button></span></div> | ||
20 | + <table width="100%" border="0" cellspacing="0" cellpadding="0" class="dy-report " | ||
21 | + th:each="row:${receiptDetails}"> | ||
22 | + <tbody> | ||
23 | + <tr style="height:40%"> | ||
24 | + <td style="margin:0px;width:100%;" align="center" > | ||
25 | + <input th:value="${row.batteryPackTwoCode}" type="hidden" name="code"/> | ||
26 | + <!--<div style="" class="qrcode"></div>--> | ||
27 | + <img th:src="@{'/image/'+${row.batteryPackTwoCode}}"> | ||
28 | + </td> | ||
29 | + </tr> | ||
30 | + <tr style=""> | ||
31 | + <td style="text-align:center"> | ||
32 | + <div class="divstyle" > | ||
33 | + <span >PACK编码:</span> | ||
34 | + <span th:text="${row.batteryPackTwoCode}"></span></div> | ||
35 | + <div class="divstyle" > | ||
36 | + <span >PACK内部种类:</span> | ||
37 | + <span>电池包</span></div> | ||
38 | + <div class="divstyle" > | ||
39 | + <span >供货商:</span> | ||
40 | + <span th:text="${row.companyName}"></span></div> | ||
41 | + <div class="divstyle" > | ||
42 | + <span >打印时间:</span> | ||
43 | + <span th:text="${row.userDef1}"></span></div> | ||
44 | + </td> | ||
45 | + </tr> | ||
46 | + | ||
47 | + </tbody> | ||
48 | + </table> | ||
49 | + </div> | ||
50 | +</div> | ||
51 | +<div th:include="include :: footer"></div> | ||
52 | +<script type="text/javascript" src="../../../js/jquery-1.4.4.min.js"></script> | ||
53 | +<script type="text/javascript" src="../../../js/jquery.jqprint-0.3.js"></script> | ||
54 | +<script type="text/javascript" src="../../../js/qrcode/qrcode.min.js"></script> | ||
55 | +<script th:inline="javascript"> | ||
56 | + function print_qrcode(){ | ||
57 | + $('.dy-report').each(function (i,item) { | ||
58 | + var code=$("input[name='code']")[i].value; | ||
59 | + //var code=$("#code").val(); | ||
60 | + var code_text=code; | ||
61 | + $(".qrcode")[i].innerHTML = ""; | ||
62 | + var QRcode=new QRCode($(this).find('.qrcode')[0],{ | ||
63 | + text:code_text, | ||
64 | + width:100, | ||
65 | + height:100, | ||
66 | + correctLevel:QRCode.CorrectLevel.L | ||
67 | + }); | ||
68 | + }); | ||
69 | + } | ||
70 | + // print_qrcode(); | ||
71 | +</script> | ||
72 | +<style type="text/css"> | ||
73 | + @media print { | ||
74 | + .noprint{display:none;} | ||
75 | + } | ||
76 | +</style> | ||
77 | +<script type="text/javascript" src="../../../js/jquery-1.4.4.min.js"></script> | ||
78 | +<script type="text/javascript" src="../../../js/jquery.jqprint-0.3.js"></script> | ||
79 | +<script type="text/javascript"> | ||
80 | + function a(){ | ||
81 | + $("#ddd").jqprint(); | ||
82 | + /*$(".qrcode").children().remove(); | ||
83 | + print_qrcode(); | ||
84 | + window.print();*/ | ||
85 | + } | ||
86 | +</script> | ||
87 | +</body> | ||
88 | +</html> | ||
0 | \ No newline at end of file | 89 | \ No newline at end of file |
src/main/resources/templates/receipt/receiptHeader/receiptHeader.html
@@ -205,9 +205,9 @@ | @@ -205,9 +205,9 @@ | ||
205 | <a class="btn btn-outline btn-success btn-rounded" onclick="receiptDetailPrint()" shiro:hasPermission="shipment:bill:report"> | 205 | <a class="btn btn-outline btn-success btn-rounded" onclick="receiptDetailPrint()" shiro:hasPermission="shipment:bill:report"> |
206 | <i class="fa fa-print"></i> 打印 | 206 | <i class="fa fa-print"></i> 打印 |
207 | </a> | 207 | </a> |
208 | - <a class="btn btn-outline btn-success btn-rounded" onclick="batteryPackagePrint()" shiro:hasPermission="shipment:bill:report"> | 208 | + <!--<a class="btn btn-outline btn-success btn-rounded" onclick="batteryPackagePrint()" shiro:hasPermission="shipment:bill:report"> |
209 | <i class="fa fa-print"></i> 电池包打印 | 209 | <i class="fa fa-print"></i> 电池包打印 |
210 | - </a> | 210 | + </a>--> |
211 | <a class="btn btn-outline btn-success btn-rounded" onclick="bindCar()" > | 211 | <a class="btn btn-outline btn-success btn-rounded" onclick="bindCar()" > |
212 | <i class="fa fa-print"></i> 绑定车辆 | 212 | <i class="fa fa-print"></i> 绑定车辆 |
213 | </a> | 213 | </a> |
src/main/resources/templates/receipt/receiving/receiving.html
@@ -160,7 +160,11 @@ | @@ -160,7 +160,11 @@ | ||
160 | <a class="btn btn-outline btn-primary btn-rounded" href="/wms/task/taskHeader?taskType=100"> | 160 | <a class="btn btn-outline btn-primary btn-rounded" href="/wms/task/taskHeader?taskType=100"> |
161 | <i class="fa fa-edit"></i> 跳转任务 | 161 | <i class="fa fa-edit"></i> 跳转任务 |
162 | </a> | 162 | </a> |
163 | + <a class="btn btn-outline btn-primary btn-rounded" onclick="batteryPackagePrints()"> | ||
164 | + <i class="fa fa-edit"></i> 电池包打印 | ||
165 | + </a> | ||
163 | </div> | 166 | </div> |
167 | + | ||
164 | <table id="bootstrap-table1" data-mobile-responsive="true" | 168 | <table id="bootstrap-table1" data-mobile-responsive="true" |
165 | class="table table-bordered table-hover text-nowrap"></table> | 169 | class="table table-bordered table-hover text-nowrap"></table> |
166 | <ul class="select-list top_text"> | 170 | <ul class="select-list top_text"> |
@@ -225,7 +229,7 @@ | @@ -225,7 +229,7 @@ | ||
225 | code: code | 229 | code: code |
226 | }, | 230 | }, |
227 | error:function (response) { | 231 | error:function (response) { |
228 | - console.log(response); | 232 | + //console.log(response); |
229 | }, | 233 | }, |
230 | success: function (value) { | 234 | success: function (value) { |
231 | var qty_show=0; | 235 | var qty_show=0; |
@@ -302,6 +306,8 @@ | @@ -302,6 +306,8 @@ | ||
302 | created: value.data[i].created, | 306 | created: value.data[i].created, |
303 | createdBy: value.data[i].createdBy, | 307 | createdBy: value.data[i].createdBy, |
304 | electricQuantity: value.data[i].electricQuantity, | 308 | electricQuantity: value.data[i].electricQuantity, |
309 | + batteryPackTwoCode: value.data[i].batteryPackTwoCode, | ||
310 | + materialIsBattery: value.data[i].materialIsBattery, | ||
305 | batteryPackageWeight: value.data[i].batteryPackageWeight | 311 | batteryPackageWeight: value.data[i].batteryPackageWeight |
306 | } | 312 | } |
307 | }); | 313 | }); |
@@ -469,9 +475,29 @@ | @@ -469,9 +475,29 @@ | ||
469 | checkbox: true, | 475 | checkbox: true, |
470 | }, | 476 | }, |
471 | { | 477 | { |
478 | + title: '操作', | ||
479 | + align: 'center', | ||
480 | + events:'operateEvents', | ||
481 | + formatter: function(value, row, index) { | ||
482 | + var actions = []; | ||
483 | + if (row.status == 0) { | ||
484 | + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>取消</a>'); | ||
485 | + } | ||
486 | + console.log(row ) | ||
487 | + if (row.batteryPackTwoCode !=''&&row.batteryPackTwoCode !=undefined) { | ||
488 | + actions.push('<a class="btn btn-danger btn-xs" href="#" onclick="batteryPackagePrint(\'' + row.id + '\')"><i class="fa fa-edit"></i>打印</a>'); | ||
489 | + } | ||
490 | + return actions.join(''); | ||
491 | + } | ||
492 | + }, | ||
493 | + { | ||
494 | + field : 'batteryPackTwoCode', | ||
495 | + title : '电池包二维码' | ||
496 | + }, | ||
497 | + /*{ | ||
472 | field : 'locationCode', | 498 | field : 'locationCode', |
473 | title : '库位编号' | 499 | title : '库位编号' |
474 | - }, | 500 | + },*/ |
475 | { | 501 | { |
476 | field : 'containerCode', | 502 | field : 'containerCode', |
477 | title : '容器编号' | 503 | title : '容器编号' |
@@ -544,18 +570,6 @@ | @@ -544,18 +570,6 @@ | ||
544 | { | 570 | { |
545 | field : 'createdBy', | 571 | field : 'createdBy', |
546 | title : '创建人' | 572 | title : '创建人' |
547 | - }, | ||
548 | - { | ||
549 | - title: '操作', | ||
550 | - align: 'center', | ||
551 | - events:'operateEvents', | ||
552 | - formatter: function(value, row, index) { | ||
553 | - var actions = []; | ||
554 | - if (row.status == 0) { | ||
555 | - actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>取消</a>'); | ||
556 | - } | ||
557 | - return actions.join(''); | ||
558 | - } | ||
559 | }] | 573 | }] |
560 | }); | 574 | }); |
561 | 575 | ||
@@ -938,6 +952,24 @@ | @@ -938,6 +952,24 @@ | ||
938 | var url = ctx + "receipt/receiving/listBarCodeHeaderCode"; | 952 | var url = ctx + "receipt/receiving/listBarCodeHeaderCode"; |
939 | $.modal.open("选择主条码", url); | 953 | $.modal.open("选择主条码", url); |
940 | } | 954 | } |
955 | + var detailPrefix = ctx + "receipt/receiptContainerDetail"; | ||
956 | + function batteryPackagePrint(id){ | ||
957 | + var url = detailPrefix + "/reportBatteryPackage/" + id; | ||
958 | + $.modal.open("入库电池包打印" , url); | ||
959 | + } | ||
960 | + function batteryPackagePrints(){ | ||
961 | + var rows=$("#bootstrap-table1").bootstrapTable('getSelections'); | ||
962 | + if (rows.length == 0) { | ||
963 | + $.modal.alertWarning("请至少选择一条记录"); | ||
964 | + return; | ||
965 | + } | ||
966 | + var ids = ""; | ||
967 | + for(var i=0; i<rows.length; i++) { | ||
968 | + ids = ids + rows[i].id + "," | ||
969 | + } | ||
970 | + var url = detailPrefix + "/reportBatteryPackage/" + ids; | ||
971 | + $.modal.open("入库电池包打印" , url); | ||
972 | + } | ||
941 | </script> | 973 | </script> |
942 | </body> | 974 | </body> |
943 | </html> | 975 | </html> |