|
@@ -15,10 +15,7 @@ import org.jeecg.modules.productionScheduleReport.entity.ProductionScheduleCaiGo
|
|
import org.jeecg.modules.productionScheduleReport.entity.ProductionScheduleWeiWai;
|
|
import org.jeecg.modules.productionScheduleReport.entity.ProductionScheduleWeiWai;
|
|
import org.jeecg.modules.productionScheduleReport.service.ProductionScheduleService;
|
|
import org.jeecg.modules.productionScheduleReport.service.ProductionScheduleService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
@@ -40,50 +37,60 @@ public class ProductionScheduleController {
|
|
@AutoLog(value = "生产进度报表-分页列表查询")
|
|
@AutoLog(value = "生产进度报表-分页列表查询")
|
|
@ApiOperation(value="生产进度报表-分页列表查询", notes="生产进度报表-分页列表查询")
|
|
@ApiOperation(value="生产进度报表-分页列表查询", notes="生产进度报表-分页列表查询")
|
|
@GetMapping(value = "/list")
|
|
@GetMapping(value = "/list")
|
|
- public Result<IPage<ProductionSchedule>> queryPageList(ProductionSchedule productionSchedule,
|
|
|
|
|
|
+ public Result<IPage<ProductionSchedule>> queryPageList(ProductionSchedule productionSchedule,String dPreDateB,String dPreDateE,
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
HttpServletRequest req) {
|
|
HttpServletRequest req) {
|
|
Result<IPage<ProductionSchedule>> result = new Result<IPage<ProductionSchedule>>();
|
|
Result<IPage<ProductionSchedule>> result = new Result<IPage<ProductionSchedule>>();
|
|
- QueryWrapper<ProductionSchedule> queryWrapper = new QueryWrapper<>();
|
|
|
|
-// QueryWrapper<ProductionSchedule> queryWrapper = QueryGenerator.initQueryWrapper(productionSchedule, req.getParameterMap());
|
|
|
|
-// SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
+
|
|
Page<ProductionSchedule> page = new Page<ProductionSchedule>(pageNo, pageSize);
|
|
Page<ProductionSchedule> page = new Page<ProductionSchedule>(pageNo, pageSize);
|
|
- // 汇总数据只取成衣订单,根据存货分类区分是否成衣还是面料
|
|
|
|
- queryWrapper.eq("len(f.cInvCCode)",6);
|
|
|
|
- if(productionSchedule != null){
|
|
|
|
|
|
+
|
|
|
|
+ QueryWrapper<ProductionSchedule> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
|
if(StringUtils.isNotBlank(productionSchedule.getCSOCode())){//销售订单号
|
|
if(StringUtils.isNotBlank(productionSchedule.getCSOCode())){//销售订单号
|
|
- queryWrapper.eq("a.cSOCode",productionSchedule.getCSOCode());
|
|
|
|
- }
|
|
|
|
- if(StringUtils.isNotBlank(productionSchedule.getCDepName())){//部门
|
|
|
|
- queryWrapper.eq("c.cDepName",productionSchedule.getCDepName());
|
|
|
|
- }
|
|
|
|
- if(StringUtils.isNotBlank(productionSchedule.getCInvName())){//物料名称
|
|
|
|
- queryWrapper.eq("f.cInvName",productionSchedule.getCInvName());
|
|
|
|
|
|
+ queryWrapper.eq("ss.cSOCode",productionSchedule.getCSOCode());
|
|
}
|
|
}
|
|
- if(StringUtils.isNotBlank(productionSchedule.getCDefine12())){//成衣加工厂
|
|
|
|
- queryWrapper.eq("a.cDefine12",productionSchedule.getCDefine12());
|
|
|
|
|
|
+// if(StringUtils.isNotBlank(productionSchedule.getCDepName())){//部门
|
|
|
|
+// queryWrapper.eq("c.cDepName",productionSchedule.getCDepName());
|
|
|
|
+// }
|
|
|
|
+// if(StringUtils.isNotBlank(productionSchedule.getCInvName())){//物料名称
|
|
|
|
+// queryWrapper.eq("f.cInvName",productionSchedule.getCInvName());
|
|
|
|
+// }
|
|
|
|
+// if(StringUtils.isNotBlank(productionSchedule.getCDefine12())){//成衣加工厂
|
|
|
|
+// queryWrapper.eq("a.cDefine12",productionSchedule.getCDefine12());
|
|
|
|
+// }
|
|
|
|
+// if(StringUtils.isNotBlank(productionSchedule.getCPersonName())){//业务员
|
|
|
|
+// queryWrapper.eq("d.cPersonName",productionSchedule.getCPersonName());
|
|
|
|
+// }
|
|
|
|
+// if(StringUtils.isNotBlank(productionSchedule.getCSOCode())){//计划单号
|
|
|
|
+// queryWrapper.eq("a.cSOCode",productionSchedule.getCSOCode());
|
|
|
|
+// }
|
|
|
|
+// if(StringUtils.isNotBlank(productionSchedule.getDDate())){//订单日期
|
|
|
|
+// queryWrapper.eq("CONVERT(nvarchar(10),a.dDate,121)",productionSchedule.getDDate());
|
|
|
|
+// }
|
|
|
|
+// if(StringUtils.isNotBlank(productionSchedule.getColor())){//颜色
|
|
|
|
+// queryWrapper.eq("b.cFree1",productionSchedule.getColor());
|
|
|
|
+// }
|
|
|
|
+ if(StringUtils.isNotBlank(dPreDateB)){//交期
|
|
|
|
+ queryWrapper.between("s.dPreDate",dPreDateB,dPreDateE);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ IPage<ProductionSchedule> pageList = productionScheduleService.selectByPage(page,queryWrapper);
|
|
|
|
+
|
|
|
|
+ //获取计划号
|
|
|
|
+ for(ProductionSchedule li:pageList.getRecords()){
|
|
|
|
+ //截取计划号
|
|
|
|
+ int indexof = li.getPlanCode().indexOf("SY");
|
|
|
|
+ if(indexof !=-1) {
|
|
|
|
+ int g = li.getPlanCode().indexOf("-", indexof);
|
|
|
|
+ if (g < 0) {
|
|
|
|
+ li.setPlanCode(li.getPlanCode().substring(indexof));
|
|
|
|
+ } else {
|
|
|
|
+ li.setPlanCode(li.getPlanCode().substring(indexof, g));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- if(StringUtils.isNotBlank(productionSchedule.getCPersonName())){//业务员
|
|
|
|
- queryWrapper.eq("d.cPersonName",productionSchedule.getCPersonName());
|
|
|
|
- }
|
|
|
|
- if(StringUtils.isNotBlank(productionSchedule.getCSOCode())){//计划单号
|
|
|
|
- queryWrapper.eq("a.cSOCode",productionSchedule.getCSOCode());
|
|
|
|
- }
|
|
|
|
- if(StringUtils.isNotBlank(productionSchedule.getDDate())){//订单日期
|
|
|
|
- queryWrapper.eq("CONVERT(nvarchar(10),a.dDate,121)",productionSchedule.getDDate());
|
|
|
|
- }
|
|
|
|
- if(StringUtils.isNotBlank(productionSchedule.getColor())){//颜色
|
|
|
|
- queryWrapper.eq("b.cFree1",productionSchedule.getColor());
|
|
|
|
- }
|
|
|
|
- if(StringUtils.isNotBlank(productionSchedule.getDPreDateBT())){//交期
|
|
|
|
- queryWrapper.eq("CONVERT(nvarchar(10),a.dPreDateBT,121)",productionSchedule.getDPreDateBT());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- IPage<ProductionSchedule> pageList = productionScheduleService.selectByPage(page, queryWrapper);
|
|
|
|
result.setSuccess(true);
|
|
result.setSuccess(true);
|
|
result.setResult(pageList);
|
|
result.setResult(pageList);
|
|
result.setMessage("查询成功");
|
|
result.setMessage("查询成功");
|
|
@@ -92,60 +99,36 @@ public class ProductionScheduleController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 生产进度报表-查看详情
|
|
* 生产进度报表-查看详情
|
|
- * @param soCode 销售订单号
|
|
|
|
- * @param marCode 存货编码
|
|
|
|
- * @param itemNumber 款号
|
|
|
|
- * @param color 颜色
|
|
|
|
- * @param planCode 计划号
|
|
|
|
|
|
+
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@AutoLog(value = "生产进度报表-查看详情")
|
|
@AutoLog(value = "生产进度报表-查看详情")
|
|
@ApiOperation(value="生产进度报表-查看详情", notes="生产进度报表-查看详情")
|
|
@ApiOperation(value="生产进度报表-查看详情", notes="生产进度报表-查看详情")
|
|
@GetMapping(value = "/getView")
|
|
@GetMapping(value = "/getView")
|
|
- public Result<ProductionSchedule> getView(String soCode,String marCode,String itemNumber,String color,String planCode){
|
|
|
|
|
|
+ public Result<ProductionSchedule> getView(String soCode){
|
|
Result<ProductionSchedule> result = new Result<ProductionSchedule>();
|
|
Result<ProductionSchedule> result = new Result<ProductionSchedule>();
|
|
- result.setSuccess(false);
|
|
|
|
- if(!StringUtils.isNotBlank(soCode)){
|
|
|
|
- result.setMessage("销售订单号不能为空");
|
|
|
|
- return result;
|
|
|
|
- }
|
|
|
|
- if(!StringUtils.isNotBlank(marCode)){
|
|
|
|
- result.setMessage("存货编码不能为空");
|
|
|
|
- return result;
|
|
|
|
- }
|
|
|
|
- if(!StringUtils.isNotBlank(itemNumber)){
|
|
|
|
- result.setMessage("款号不能为空");
|
|
|
|
- return result;
|
|
|
|
- }
|
|
|
|
- if(!StringUtils.isNotBlank(color)){
|
|
|
|
- result.setMessage("颜色不能为空");
|
|
|
|
- return result;
|
|
|
|
- }
|
|
|
|
- if(!StringUtils.isNotBlank(planCode)){
|
|
|
|
- result.setMessage("计划号不能为空");
|
|
|
|
- return result;
|
|
|
|
- }
|
|
|
|
- QueryWrapper<ProductionSchedule> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
|
|
|
- queryWrapper.eq("len(f.cInvCCode)",6);
|
|
|
|
- queryWrapper.eq("a.cSOCode",soCode);
|
|
|
|
- queryWrapper.eq("b.cInvCode",marCode);
|
|
|
|
- queryWrapper.eq("b.cDefine22",itemNumber);
|
|
|
|
- queryWrapper.eq("b.cFree1",color);
|
|
|
|
- queryWrapper.eq("p.PlanCode",planCode);
|
|
|
|
|
|
+ QueryWrapper<ProductionSchedule> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ if(StringUtils.isBlank(soCode)){//销售订单号
|
|
|
|
+ result.setMessage("销售订单号不能为空");
|
|
|
|
+ result.setSuccess(false);
|
|
|
|
+ return result;
|
|
|
|
+ }else{
|
|
|
|
+ queryWrapper.eq("ss.cSOCode",soCode);
|
|
|
|
+ }
|
|
|
|
|
|
ProductionSchedule entity = new ProductionSchedule();
|
|
ProductionSchedule entity = new ProductionSchedule();
|
|
- List<ProductionSchedule> list = productionScheduleService.selectByView(queryWrapper); // 详情数据
|
|
|
|
- if(list.size() > 0){
|
|
|
|
- entity = list.get(0);
|
|
|
|
- }
|
|
|
|
|
|
+// List<ProductionSchedule> list = productionScheduleService.selectByView(queryWrapper); // 详情数据
|
|
|
|
+// if(list.size() > 0){
|
|
|
|
+// entity = list.get(0);
|
|
|
|
+// }
|
|
|
|
|
|
//根据计划号 查询采购订单
|
|
//根据计划号 查询采购订单
|
|
- List<ProductionScheduleCaiGou> selectCaiGou = productionScheduleService.selectCaiGou(planCode);
|
|
|
|
- entity.setProductionScheduleCaiGou(selectCaiGou);
|
|
|
|
|
|
+// List<ProductionScheduleCaiGou> selectCaiGou = productionScheduleService.selectCaiGou(planCode);
|
|
|
|
+// entity.setProductionScheduleCaiGou(selectCaiGou);
|
|
//根据计划号查询委外订单
|
|
//根据计划号查询委外订单
|
|
- List<ProductionScheduleWeiWai> selectWeiWai = productionScheduleService.selectWeiWai(planCode);
|
|
|
|
- entity.setProductionScheduleWeiWai(selectWeiWai);
|
|
|
|
|
|
+// List<ProductionScheduleWeiWai> selectWeiWai = productionScheduleService.selectWeiWai(planCode);
|
|
|
|
+// entity.setProductionScheduleWeiWai(selectWeiWai);
|
|
|
|
|
|
result.setResult(entity);
|
|
result.setResult(entity);
|
|
|
|
|
|
@@ -163,7 +146,4 @@ public class ProductionScheduleController {
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
|
- System.out.println(getToken());
|
|
|
|
- }
|
|
|
|
}
|
|
}
|