@@ -14,7 +14,6 @@ | |||
<result column="process_id" jdbcType="INTEGER" property="processId" /> | |||
<result column="batch_det_id" jdbcType="INTEGER" property="batchDetId" /> | |||
<result column="batch_det_code" jdbcType="VARCHAR" property="batchDetCode" /> | |||
<result column="product_det_barcode" jdbcType="VARCHAR" property="productDetBarcode" /> | |||
<result column="grade" jdbcType="INTEGER" property="grade" /> | |||
<result column="winding_machine_id" jdbcType="INTEGER" property="windingMachineId" /> | |||
<result column="company_id" jdbcType="INTEGER" property="companyId" /> | |||
@@ -57,12 +57,6 @@ public class ProductBatchDetect { | |||
@Column(name = "batch_det_code") | |||
private String batchDetCode; | |||
/** | |||
* 明细编码,对应产品卷布编码,不同工序布卷不同编码,根据不同情况系统自行生成 | |||
*/ | |||
@Column(name = "product_det_barcode") | |||
private String productDetBarcode; | |||
/** | |||
* 等级,1为一等品,2:二等品,3:等品。。。 | |||
*/ | |||
@@ -217,24 +211,6 @@ public class ProductBatchDetect { | |||
this.batchDetCode = batchDetCode; | |||
} | |||
/** | |||
* 获取明细编码,对应产品卷布编码,不同工序布卷不同编码,根据不同情况系统自行生成 | |||
* | |||
* @return product_det_barcode - 明细编码,对应产品卷布编码,不同工序布卷不同编码,根据不同情况系统自行生成 | |||
*/ | |||
public String getProductDetBarcode() { | |||
return productDetBarcode; | |||
} | |||
/** | |||
* 设置明细编码,对应产品卷布编码,不同工序布卷不同编码,根据不同情况系统自行生成 | |||
* | |||
* @param productDetBarcode 明细编码,对应产品卷布编码,不同工序布卷不同编码,根据不同情况系统自行生成 | |||
*/ | |||
public void setProductDetBarcode(String productDetBarcode) { | |||
this.productDetBarcode = productDetBarcode; | |||
} | |||
/** | |||
* 获取等级,1为一等品,2:二等品,3:等品。。。 | |||
* | |||
@@ -0,0 +1,42 @@ | |||
package com.deer.wms.produce.manage.model; | |||
import java.util.List; | |||
/** | |||
* 该结构包含批次加工单、工序、批次明细,以及检测等级和瑕疵明细信息 | |||
* @Author: hy | |||
* @Date: 2020/3/20 15:29 | |||
* @Version 1.0 | |||
*/ | |||
public class ProductBatchDetectInfo { | |||
private ProductProcessBatchDetInfo productProcessBatchDetInfo;//批次加工单、工序、批次明细信息 | |||
private ProductBatchDetect productBatchDetect;//检测等级 | |||
private List<ProductBatchDetectDet> productBatchDetectDetList;//瑕疵名细 | |||
public ProductProcessBatchDetInfo getProductProcessBatchDetInfo() { | |||
return productProcessBatchDetInfo; | |||
} | |||
public void setProductProcessBatchDetInfo(ProductProcessBatchDetInfo productProcessBatchDetInfo) { | |||
this.productProcessBatchDetInfo = productProcessBatchDetInfo; | |||
} | |||
public ProductBatchDetect getProductBatchDetect() { | |||
return productBatchDetect; | |||
} | |||
public void setProductBatchDetect(ProductBatchDetect productBatchDetect) { | |||
this.productBatchDetect = productBatchDetect; | |||
} | |||
public List<ProductBatchDetectDet> getProductBatchDetectDetList() { | |||
return productBatchDetectDetList; | |||
} | |||
public void setProductBatchDetectDetList(List<ProductBatchDetectDet> productBatchDetectDetList) { | |||
this.productBatchDetectDetList = productBatchDetectDetList; | |||
} | |||
} |
@@ -1,6 +1,8 @@ | |||
package com.deer.wms.produce.manage.service; | |||
import com.deer.wms.intercept.common.data.CurrentUser; | |||
import com.deer.wms.produce.manage.model.ProductBatchDetect; | |||
import com.deer.wms.produce.manage.model.ProductBatchDetectInfo; | |||
import com.deer.wms.produce.manage.model.ProductBatchDetectParams; | |||
import com.deer.wms.project.seed.core.service.Service; | |||
@@ -14,4 +16,5 @@ public interface ProductBatchDetectService extends Service<ProductBatchDetect, I | |||
List<ProductBatchDetect> findList(ProductBatchDetectParams params) ; | |||
void saveDetectRusult(ProductBatchDetectInfo productBatchDetectInfo, CurrentUser currentUser); | |||
} |
@@ -1,14 +1,17 @@ | |||
package com.deer.wms.produce.manage.service.impl; | |||
import com.deer.wms.intercept.common.data.CurrentUser; | |||
import com.deer.wms.produce.manage.dao.ProductBatchDetectMapper; | |||
import com.deer.wms.produce.manage.model.ProductBatchDetect; | |||
import com.deer.wms.produce.manage.model.ProductBatchDetectParams; | |||
import com.deer.wms.produce.manage.model.*; | |||
import com.deer.wms.produce.manage.service.ProductBatchDetectDetService; | |||
import com.deer.wms.produce.manage.service.ProductBatchDetectService; | |||
import com.deer.wms.project.seed.core.service.AbstractService; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import java.util.Date; | |||
import java.util.List; | |||
/** | |||
@@ -21,9 +24,47 @@ public class ProductBatchDetectServiceImpl extends AbstractService<ProductBatchD | |||
@Autowired | |||
private ProductBatchDetectMapper productBatchDetectMapper; | |||
@Autowired | |||
private ProductBatchDetectDetService productBatchDetectDetService; | |||
@Override | |||
public List<ProductBatchDetect> findList(ProductBatchDetectParams params) { | |||
return productBatchDetectMapper.findList(params); | |||
} | |||
@Override | |||
public void saveDetectRusult(ProductBatchDetectInfo productBatchDetectInfo, CurrentUser currentUser) { | |||
Date date = new Date(); | |||
ProductProcessBatchDetInfo productProcessBatchDetInfo = productBatchDetectInfo.getProductProcessBatchDetInfo(); | |||
MtAloneProcessVo processVo = productProcessBatchDetInfo.getProcessVo();//获取工序 | |||
ProductProcessBatchDet productProcessBatchDet = productProcessBatchDetInfo.getProductProcessBatchDet();//获取批次明细 | |||
/**检测等级赋值**/ | |||
ProductBatchDetect productBatchDetect = productBatchDetectInfo.getProductBatchDetect(); | |||
productBatchDetect.setOperatorId(currentUser.getUserId()); | |||
productBatchDetect.setCreateTime(date); | |||
productBatchDetect.setUpdateTime(date); | |||
productBatchDetect.setVersion("1.1"); | |||
productBatchDetect.setStatus(0); | |||
productBatchDetect.setProcessId(processVo.getId()); | |||
productBatchDetect.setBatchDetId(productProcessBatchDet.getId()); | |||
productBatchDetect.setBatchDetCode(productProcessBatchDet.getBatchDetCode()); | |||
productBatchDetect.setCompanyId(currentUser.getCompanyId()); | |||
productBatchDetectMapper.insert(productBatchDetect); | |||
/**瑕疵名细赋值**/ | |||
List<ProductBatchDetectDet> productBatchDetectDetList = productBatchDetectInfo.getProductBatchDetectDetList(); | |||
if(null!=productBatchDetectDetList && productBatchDetectDetList.size()!=0) { | |||
for (ProductBatchDetectDet productBatchDetectDet : productBatchDetectDetList) { | |||
productBatchDetectDet.setOperatorId(currentUser.getUserId()); | |||
productBatchDetectDet.setCreateTime(date); | |||
productBatchDetectDet.setUpdateTime(date); | |||
productBatchDetectDet.setVersion("1.1"); | |||
productBatchDetectDet.setStatus(0); | |||
productBatchDetectDet.setProcessId(processVo.getId()); | |||
productBatchDetectDet.setBatchDetId(productProcessBatchDet.getId()); | |||
productBatchDetectDet.setCompanyId(currentUser.getCompanyId()); | |||
} | |||
productBatchDetectDetService.save(productBatchDetectDetList); | |||
} | |||
} | |||
} |
@@ -1,5 +1,6 @@ | |||
package com.deer.wms.produce.manage.web; | |||
import com.deer.wms.produce.manage.model.ProductBatchDetectInfo; | |||
import com.deer.wms.project.seed.annotation.OperateLog; | |||
import com.deer.wms.project.seed.constant.SystemManageConstant; | |||
import com.deer.wms.project.seed.core.result.CommonCode; | |||
@@ -14,6 +15,8 @@ import com.github.pagehelper.PageHelper; | |||
import com.github.pagehelper.PageInfo; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiImplicitParam; | |||
import io.swagger.annotations.ApiImplicitParams; | |||
import io.swagger.annotations.ApiOperation; | |||
import springfox.documentation.annotations.ApiIgnore; | |||
@@ -28,7 +31,7 @@ import java.util.List; | |||
/** | |||
* Created by on 2019/09/09. | |||
*/ | |||
@Api(description = "xxx接口") | |||
@Api(description = "检测等级接口") | |||
@RestController | |||
@RequestMapping("/product/batch/detects") | |||
public class ProductBatchDetectController { | |||
@@ -89,16 +92,25 @@ public class ProductBatchDetectController { | |||
return ResultGenerator.genSuccessResult(pageInfo); | |||
} | |||
/** | |||
* hy正在用(打卷系统) | |||
* 保存工序和批次明细对应的检测等级和瑕疵名细 | |||
* @param productBatchDetectInfo | |||
* @param currentUser | |||
* @return | |||
*/ | |||
@ApiOperation(value = "保存检测等级和瑕疵名细", notes = "保存检测等级和瑕疵名细") | |||
@ApiImplicitParams({ | |||
@ApiImplicitParam(name = "productBatchDetectInfo", value = "批次加工单、工序、批次明细、检测等级、瑕疵名细混合对象", paramType = "body", dataType = "ProductBatchDetectInfo", required = true) | |||
}) | |||
@OperateLog(description = "保存检测等级和瑕疵名细", type = "增加") | |||
@PostMapping("/saveDetectRusult") | |||
public Result saveDetectRusult(@RequestBody ProductBatchDetectInfo productBatchDetectInfo, @ApiIgnore @User CurrentUser currentUser) { | |||
if(currentUser==null){ | |||
return ResultGenerator.genFailResult( CommonCode.SERVICE_ERROR,"未登录错误",null ); | |||
} | |||
//@OperateLog(description = "保存检测结果", type = "增加") | |||
//@ApiOperation(value = "保存检测结果", notes = "保存检测结果") | |||
//@PostMapping("/saveDetectRusult") | |||
//public Result saveDetectRusult(@RequestBody ProductBatchDetect productBatchDetect, @ApiIgnore @User CurrentUser currentUser) { | |||
// if(currentUser==null){ | |||
// return ResultGenerator.genFailResult( CommonCode.SERVICE_ERROR,"未登录错误",null ); | |||
// } | |||
// | |||
// productBatchDetectService.saveDetectRusult(productBatchDetect); | |||
// return ResultGenerator.genSuccessResult(); | |||
//} | |||
productBatchDetectService.saveDetectRusult(productBatchDetectInfo, currentUser); | |||
return ResultGenerator.genSuccessResult(); | |||
} | |||
} |