|
@@ -5,12 +5,18 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.framework.web.service.TokenService;
|
|
import com.ruoyi.framework.web.service.TokenService;
|
|
|
|
|
+import com.ruoyi.web.base.domain.BaseMaterial;
|
|
|
|
|
+import com.ruoyi.web.base.domain.ProductionRegular;
|
|
|
import com.ruoyi.web.base.domain.ProductionSlaughter;
|
|
import com.ruoyi.web.base.domain.ProductionSlaughter;
|
|
|
import com.ruoyi.web.base.domain.ProductionWhiteStripAllocation;
|
|
import com.ruoyi.web.base.domain.ProductionWhiteStripAllocation;
|
|
|
import com.ruoyi.web.base.domain.param.WiteStripAllRequest;
|
|
import com.ruoyi.web.base.domain.param.WiteStripAllRequest;
|
|
|
|
|
+import com.ruoyi.web.base.service.IBaseMaterialService;
|
|
|
|
|
+import com.ruoyi.web.base.service.IProductionRegularService;
|
|
|
|
|
+import com.ruoyi.web.base.service.IProductionSlaughterService;
|
|
|
import com.ruoyi.web.base.service.IProductionWhiteStripAllocationService;
|
|
import com.ruoyi.web.base.service.IProductionWhiteStripAllocationService;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.security.core.parameters.P;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -26,6 +32,10 @@ public class ProductionWhiteStripAllocationController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IProductionWhiteStripAllocationService productionWhiteStripAllocationService;
|
|
private IProductionWhiteStripAllocationService productionWhiteStripAllocationService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
|
|
+ private IProductionRegularService regularService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IBaseMaterialService baseMaterialService;
|
|
|
|
|
+ @Autowired
|
|
|
private TokenService tokenService;
|
|
private TokenService tokenService;
|
|
|
|
|
|
|
|
@ApiOperation("白条分配添加")
|
|
@ApiOperation("白条分配添加")
|
|
@@ -35,8 +45,57 @@ public class ProductionWhiteStripAllocationController {
|
|
|
|
|
|
|
|
allocation.setOrgId(loginOrgId);
|
|
allocation.setOrgId(loginOrgId);
|
|
|
allocation.setCreateBy(getUsername());
|
|
allocation.setCreateBy(getUsername());
|
|
|
|
|
+ Integer regularId = allocation.getRegularId();
|
|
|
|
|
+ ProductionRegular productionRegular = new ProductionRegular();
|
|
|
|
|
+ productionRegular.setId(regularId);
|
|
|
|
|
+ productionRegular.setIsFenpei(1);
|
|
|
|
|
+ regularService.updateById(productionRegular);
|
|
|
return success(productionWhiteStripAllocationService.save(allocation));
|
|
return success(productionWhiteStripAllocationService.save(allocation));
|
|
|
}
|
|
}
|
|
|
|
|
+ @ApiOperation("白条分配批量添加")
|
|
|
|
|
+ @PostMapping("/addBatch")
|
|
|
|
|
+ public AjaxResult addBatch(@RequestBody WiteStripAllRequest witeStripAllRequest, HttpServletRequest request) throws Exception {
|
|
|
|
|
+ String loginOrgId = tokenService.getLoginOrgId(request);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ String ids = witeStripAllRequest.getIds();
|
|
|
|
|
+ for (String id : ids.split(",")) {
|
|
|
|
|
+ ProductionRegular byId = regularService.getById(id);
|
|
|
|
|
+ byId.setIsFenpei(1);
|
|
|
|
|
+ regularService.updateById(byId);
|
|
|
|
|
+ ProductionWhiteStripAllocation allocation = new ProductionWhiteStripAllocation();
|
|
|
|
|
+ allocation.setOrgId(loginOrgId);
|
|
|
|
|
+ allocation.setCreateBy(getUsername());
|
|
|
|
|
+ allocation.setAnimalIdentification(byId.getAnimalIdentification());
|
|
|
|
|
+// allocation.setBatchNumber();
|
|
|
|
|
+ allocation.setCoatColor(byId.getCoatColor());
|
|
|
|
|
+ allocation.setCustomer(witeStripAllRequest.getCustomer());
|
|
|
|
|
+// allocation.setDeductionScore(witeStripAllRequest.getd());
|
|
|
|
|
+ allocation.setDeliveryCustomer(witeStripAllRequest.getDeliveryCustomer());
|
|
|
|
|
+ allocation.setDeliveryDate(witeStripAllRequest.getDeliveryDate());
|
|
|
|
|
+ allocation.setGrade(byId.getGrade());
|
|
|
|
|
+ allocation.setMarket(witeStripAllRequest.getMarket());
|
|
|
|
|
+ allocation.setLockedLogisticsLine(witeStripAllRequest.getLockedLogisticsLine());
|
|
|
|
|
+ BaseMaterial material = baseMaterialService.getOne(new QueryWrapper<BaseMaterial>().eq("goods_num", byId.getGoodsNum()));
|
|
|
|
|
+
|
|
|
|
|
+ allocation.setMaterialName(material.getGoodsName());
|
|
|
|
|
+// allocation.setOrderUnallocatedQuantity(witeStripAllRequest.geto);
|
|
|
|
|
+ allocation.setPigBatch(byId.getPigBatch());
|
|
|
|
|
+ allocation.setProductionDate(witeStripAllRequest.getProductionDate());
|
|
|
|
|
+ allocation.setRegularId(Integer.parseInt(id));
|
|
|
|
|
+ allocation.setSaleId(witeStripAllRequest.getSaleId());
|
|
|
|
|
+ allocation.setSaleNum(witeStripAllRequest.getSaleNum());
|
|
|
|
|
+ allocation.setVariety(byId.getVariety());
|
|
|
|
|
+// allocation.setWeight(witeStripAllRequest.getw);
|
|
|
|
|
+ allocation.setWhiteStripNumber(byId.getWhiteStripNumber());
|
|
|
|
|
+
|
|
|
|
|
+ productionWhiteStripAllocationService.save(allocation);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ return success();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@ApiOperation("白条分配修改")
|
|
@ApiOperation("白条分配修改")
|
|
|
@PostMapping("/edit")
|
|
@PostMapping("/edit")
|
|
@@ -52,6 +111,12 @@ public class ProductionWhiteStripAllocationController {
|
|
|
public AjaxResult delete(@RequestBody Map<String, String> paramsMap) {
|
|
public AjaxResult delete(@RequestBody Map<String, String> paramsMap) {
|
|
|
String ids = paramsMap.get("ids");
|
|
String ids = paramsMap.get("ids");
|
|
|
for (String id : ids.split(",")) {
|
|
for (String id : ids.split(",")) {
|
|
|
|
|
+ ProductionWhiteStripAllocation byId = productionWhiteStripAllocationService.getById(id);
|
|
|
|
|
+ ProductionRegular productionRegular = new ProductionRegular();
|
|
|
|
|
+ productionRegular.setId(byId.getRegularId());
|
|
|
|
|
+ productionRegular.setIsFenpei(0);
|
|
|
|
|
+ regularService.updateById(productionRegular);
|
|
|
|
|
+
|
|
|
productionWhiteStripAllocationService.removeById(id);
|
|
productionWhiteStripAllocationService.removeById(id);
|
|
|
}
|
|
}
|
|
|
return success();
|
|
return success();
|
|
@@ -72,11 +137,11 @@ public class ProductionWhiteStripAllocationController {
|
|
|
) {
|
|
) {
|
|
|
QueryWrapper<ProductionWhiteStripAllocation> wrapper = new QueryWrapper<ProductionWhiteStripAllocation>()
|
|
QueryWrapper<ProductionWhiteStripAllocation> wrapper = new QueryWrapper<ProductionWhiteStripAllocation>()
|
|
|
.eq("org_id", tokenService.getLoginOrgId(request));
|
|
.eq("org_id", tokenService.getLoginOrgId(request));
|
|
|
- wrapper
|
|
|
|
|
- .eq(StringUtils.isNotEmpty(witeStripAllRequest.getMaterialCode()), "material_code", witeStripAllRequest.getMaterialCode())
|
|
|
|
|
- .eq(StringUtils.isNotEmpty(witeStripAllRequest.getSaleNum()), "sale_num", witeStripAllRequest.getSaleNum())
|
|
|
|
|
- .eq(StringUtils.isNotEmpty(witeStripAllRequest.getProductionDate()), "production_date", witeStripAllRequest.getProductionDate());
|
|
|
|
|
-
|
|
|
|
|
|
|
+// wrapper
|
|
|
|
|
+// .like(StringUtils.isNotEmpty(witeStripAllRequest.getMaterialCode()), "material_code", witeStripAllRequest.getMaterialCode())
|
|
|
|
|
+// .like(StringUtils.isNotEmpty(witeStripAllRequest.getSaleNum()), "sale_num", witeStripAllRequest.getSaleNum())
|
|
|
|
|
+// .eq(StringUtils.isNotEmpty(witeStripAllRequest.getProductionDate()), "production_date", witeStripAllRequest.getProductionDate());
|
|
|
|
|
+ wrapper.eq("sale_id",witeStripAllRequest.getSaleId() );
|
|
|
return success(productionWhiteStripAllocationService.list(
|
|
return success(productionWhiteStripAllocationService.list(
|
|
|
wrapper
|
|
wrapper
|
|
|
));
|
|
));
|