|
...
|
...
|
@@ -3,6 +3,7 @@ package org.jeecg.modules.erp.order_form.controller; |
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
...
|
...
|
@@ -10,15 +11,12 @@ import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
|
import org.apache.shiro.subject.Subject;
|
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
|
import org.jeecg.common.system.util.JwtUtil;
|
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
|
import org.jeecg.modules.erp.bidding_info.form.BiddingShenqForm;
|
|
|
|
import org.jeecg.modules.erp.order_form.entity.TblOrderForm;
|
|
|
|
import org.jeecg.modules.erp.order_form.entity.TblProductType;
|
|
|
|
import org.jeecg.modules.erp.order_form.entity.TblWorkOrder;
|
|
...
|
...
|
@@ -27,6 +25,10 @@ import org.jeecg.modules.erp.order_form.form.OrderForm; |
|
|
|
import org.jeecg.modules.erp.order_form.service.ITblOrderFormService;
|
|
|
|
import org.jeecg.modules.erp.order_form.service.ITblWorkOrderService;
|
|
|
|
import org.jeecg.modules.erp.order_form.service.ITblWorkPriceService;
|
|
|
|
import org.jeecg.modules.erp.production.entity.TblProductionGongxu;
|
|
|
|
import org.jeecg.modules.erp.production.entity.TblProductionPlan;
|
|
|
|
import org.jeecg.modules.erp.production.service.ITblProductionGongxuService;
|
|
|
|
import org.jeecg.modules.erp.production.service.ITblProductionPlanService;
|
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
...
|
...
|
@@ -41,6 +43,7 @@ import org.springframework.web.servlet.ModelAndView; |
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
...
|
...
|
@@ -68,7 +71,8 @@ public class TblOrderFormController extends JeecgController<TblOrderForm, ITblOr |
|
|
|
@Autowired
|
|
|
|
private ITblWorkPriceService iTblWorkPriceService;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private ITblProductionPlanService planService;
|
|
|
|
|
|
|
|
/*---------------------------------主表处理-begin-------------------------------------*/
|
|
|
|
|
|
...
|
...
|
@@ -87,9 +91,20 @@ public class TblOrderFormController extends JeecgController<TblOrderForm, ITblOr |
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
|
HttpServletRequest req) {
|
|
|
|
// QueryWrapper<TblOrderForm> queryWrapper = QueryGenerator.initQueryWrapper(tblOrderForm, req.getParameterMap());
|
|
|
|
|
|
|
|
QueryWrapper<TblOrderForm> queryWrapper = QueryGenerator.initQueryWrapper(tblOrderForm, req.getParameterMap());
|
|
|
|
Page<TblOrderForm> page = new Page<TblOrderForm>(pageNo, pageSize);
|
|
|
|
IPage<TblOrderForm> pageList = tblOrderFormService.selectList(page, tblOrderForm);
|
|
|
|
IPage<TblOrderForm> pageList = tblOrderFormService.page(page, queryWrapper);
|
|
|
|
for (TblOrderForm order : pageList.getRecords()) {
|
|
|
|
// 查询与订单号相关的数据
|
|
|
|
List<TblProductionPlan> productionGongxuList = planService.list(new QueryWrapper<TblProductionPlan>().eq("order_number", order.getOrderId()));
|
|
|
|
for (TblProductionPlan productionGongxu : productionGongxuList) {
|
|
|
|
order.setDispatchedWorkingHours(String.valueOf(productionGongxu.getPai()));
|
|
|
|
tblOrderFormService.updateById(order);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
return Result.OK(pageList);
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -135,31 +150,27 @@ public class TblOrderFormController extends JeecgController<TblOrderForm, ITblOr |
|
|
|
return Result.OK("编辑成功!");
|
|
|
|
}
|
|
|
|
|
|
|
|
// // 分派设计人员
|
|
|
|
// @RequestMapping(value = "/updateDesigner", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
|
// public Result<String> updateDesigner(@RequestBody TblOrderForm tblOrderForm) {
|
|
|
|
//// tblOrderForm.setAssignDesignDate(new Date());
|
|
|
|
// tblOrderForm.setAssignDesignStatus("1");
|
|
|
|
// tblOrderFormService.updateDesignerByOrderId(tblOrderForm);
|
|
|
|
// return Result.OK("分派成功!");
|
|
|
|
// }
|
|
|
|
|
|
|
|
// //产品设计订单列表
|
|
|
|
// @GetMapping(value = "/productDesignList")
|
|
|
|
// public Result<IPage<TblOrderForm>> getProductDesignList(TblOrderForm tblOrderForm,
|
|
|
|
// @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
|
// @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
|
// HttpServletRequest req) {
|
|
|
|
//
|
|
|
|
// String userNameByToken = JwtUtil.getUserNameByToken(req);
|
|
|
|
//
|
|
|
|
// QueryWrapper<TblOrderForm> queryWrapper = QueryGenerator.initQueryWrapper(tblOrderForm, req.getParameterMap());
|
|
|
|
//// queryWrapper.isNotNull("designer");
|
|
|
|
// queryWrapper.eq("designer", userNameByToken);
|
|
|
|
// Page<TblOrderForm> page = new Page<TblOrderForm>(pageNo, pageSize);
|
|
|
|
// IPage<TblOrderForm> pageList = tblOrderFormService.page(page, queryWrapper);
|
|
|
|
// return Result.OK(pageList);
|
|
|
|
// }
|
|
|
|
// 分派设计人员
|
|
|
|
@RequestMapping(value = "/updateDesigner", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
|
public Result<String> updateDesigner(@RequestBody TblOrderForm tblOrderForm) {
|
|
|
|
// tblOrderForm.setAssignDesignDate(new Date());
|
|
|
|
tblOrderForm.setAssignDesignStatus("1");
|
|
|
|
tblOrderFormService.updateDesignerByOrderId(tblOrderForm);
|
|
|
|
return Result.OK("分派成功!");
|
|
|
|
}
|
|
|
|
|
|
|
|
//产品设计订单列表
|
|
|
|
@GetMapping(value = "/productDesignList")
|
|
|
|
public Result<IPage<TblOrderForm>> getProductDesignList(TblOrderForm tblOrderForm,
|
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
|
HttpServletRequest req) {
|
|
|
|
QueryWrapper<TblOrderForm> queryWrapper = QueryGenerator.initQueryWrapper(tblOrderForm, req.getParameterMap());
|
|
|
|
queryWrapper.isNotNull("designer");
|
|
|
|
Page<TblOrderForm> page = new Page<TblOrderForm>(pageNo, pageSize);
|
|
|
|
IPage<TblOrderForm> pageList = tblOrderFormService.page(page, queryWrapper);
|
|
|
|
return Result.OK(pageList);
|
|
|
|
}
|
|
|
|
|
|
|
|
//通过id查询一条订单
|
|
|
|
@GetMapping(value = "/queryById/{id}")
|
|
...
|
...
|
@@ -196,11 +207,11 @@ public class TblOrderFormController extends JeecgController<TblOrderForm, ITblOr |
|
|
|
@ApiOperation(value="订单表-通过id删除", notes="订单表-通过id删除")
|
|
|
|
@DeleteMapping(value = "/delete")
|
|
|
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
|
|
// TblOrderForm orderForm = tblOrderFormService.getById(id);
|
|
|
|
// if (!orderForm.getStatus().equals("未下单")){
|
|
|
|
// return Result.error("订单已开始,不允许删除");
|
|
|
|
// }
|
|
|
|
tblOrderFormService.removeById(id);
|
|
|
|
TblOrderForm orderForm = tblOrderFormService.getById(id);
|
|
|
|
if (!orderForm.getStatus().equals("未下单")){
|
|
|
|
return Result.error("订单已开始,不允许删除");
|
|
|
|
}
|
|
|
|
tblOrderFormService.delMain(id);
|
|
|
|
return Result.OK("删除成功!");
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|