src/main/java/com/ruoyi/approve/bean/vo/ApproveProcessVO.java
@@ -3,15 +3,11 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.framework.aspectj.lang.annotation.Excel; import io.swagger.annotations.ApiModelProperty; import com.ruoyi.sales.pojo.CommonFile; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotBlank; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Date; import java.util.List; @Data src/main/java/com/ruoyi/approve/controller/ApproveProcessController.java
@@ -2,16 +2,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.account.pojo.AccountExpense; import com.ruoyi.approve.pojo.ApproveProcess; import com.ruoyi.approve.service.IApproveProcessService; import com.ruoyi.approve.bean.vo.ApproveGetAndUpdateVo; import com.ruoyi.approve.bean.vo.ApproveProcessVO; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.approve.pojo.ApproveProcess; import com.ruoyi.approve.service.IApproveProcessService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.security.LoginUser; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.project.system.domain.SysDept; import com.ruoyi.project.system.service.ISysDeptService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -20,7 +18,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.text.ParseException; import java.util.List; @RestController @@ -28,11 +25,8 @@ @Api(tags = "审批") public class ApproveProcessController { @GetMapping("/test") public AjaxResult test() { System.out.println(1111); return AjaxResult.success("测试"); } @Autowired private ISysDeptService sysDeptService; @Autowired @@ -43,11 +37,7 @@ */ @GetMapping("/getDept") public AjaxResult getDept() { Long userId = SecurityUtils.getUserId(); LoginUser user = SecurityUtils.getLoginUser(); Long[] deptIds = SecurityUtils.getDeptId(); List<SysDept> sysDeptList = approveProcessService.selectDeptListByDeptIds(deptIds); List<SysDept> sysDeptList =sysDeptService.selectDeptList(new SysDept()); return AjaxResult.success(sysDeptList); } @@ -115,7 +105,7 @@ @DeleteMapping("/deleteIds") @ApiOperation(value = "删除审批") @Transactional(rollbackFor = Exception.class) public AjaxResult deleteIds(@RequestBody List<Long> ids) { public AjaxResult deleteIds(@RequestBody List<String> ids) { if (ids == null || ids.size() == 0) { return AjaxResult.warn("参数不能为空"); } src/main/java/com/ruoyi/approve/pojo/ApproveLog.java
@@ -29,7 +29,7 @@ /** * 审批id */ private Long approveId; private String approveId; /** * 审批节点顺序 src/main/java/com/ruoyi/approve/pojo/ApproveProcess.java
@@ -139,13 +139,13 @@ @ApiModelProperty(value = "审批备注") private String approveRemark; @Excel(name = "开始时间", dateFormat = "yyyy-MM-dd",width = 30) @Excel(name = "开始时间", dateFormat = "yyyy-MM-dd HH:mm:ss",width = 30) @ApiModelProperty(value = "开始时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime startDate; @Excel(name = "结束时间", dateFormat = "yyyy-MM-dd",width = 30) @Excel(name = "结束时间", dateFormat = "yyyy-MM-dd HH:mm:ss",width = 30) @ApiModelProperty(value = "结束时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") src/main/java/com/ruoyi/approve/service/IApproveProcessService.java
@@ -25,7 +25,7 @@ IPage<ApproveProcess> listAll(Page page, ApproveProcess approveProcess); void delApprove(List<Long> ids); void delApprove(List<String> ids); void updateByApproveId(ApproveGetAndUpdateVo approveGetAndUpdateVo) throws IOException; src/main/java/com/ruoyi/approve/service/impl/ApproveProcessServiceImpl.java
@@ -83,7 +83,7 @@ // String approveID = today + formattedCount; SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); ApproveProcess approveProcess = new ApproveProcess(); String no = OrderUtils.countTodayByCreateTime(approveProcessMapper, "CGSP"); String no = OrderUtils.countAfterServiceTodayByCreateTime(approveProcessMapper, "CGSP"); approveProcess.setApproveId(no); approveProcess.setApproveUser(sysUser.getUserId()); approveProcess.setApproveUserName(sysUser.getNickName()); @@ -240,8 +240,8 @@ } @Override public void delApprove(List<Long> ids) { for (Long approveId : ids) { public void delApprove(List<String> ids) { for (String approveId : ids) { ApproveProcess approveProcess = approveProcessMapper.selectOne(new LambdaQueryWrapper<ApproveProcess>() .eq(ApproveProcess::getApproveId, approveId) .eq(ApproveProcess::getApproveDelete, 0) @@ -254,7 +254,7 @@ // 删除对应的附件 commonFileService.deleteByBusinessId(approveProcess.getId(), FileNameType.ApproveProcess.getValue()); // 删除审批节点 approveNodeService.delApproveNodeByApproveId(approveId.toString()); approveNodeService.delApproveNodeByApproveId(approveId); // 只查最新一条审批流程 ApproveProcess latestProcess = approveProcessMapper.selectOne( src/main/java/com/ruoyi/basic/dto/ProductModelAnticlockwiseDto.java
@@ -17,4 +17,8 @@ private String subUnit; private String type; private Long id; } src/main/java/com/ruoyi/basic/service/impl/ProductModelServiceImpl.java
@@ -169,7 +169,12 @@ //反向新增成品产品,只有销售关联新增的时候调用 @Override public Long productModelAnticlockwise(ProductModelAnticlockwiseDto productModelDto) { ProductModel oldProductModel = productModelMapper.selectOldProductModel(productModelDto.getModel(), productModelDto.getProductName()); ProductModel oldProductModel = new ProductModel(); if (ObjectUtils.isNotEmpty(productModelDto.getId())) { oldProductModel = productModelMapper.selectById(productModelDto.getId()); }else { oldProductModel = productModelMapper.selectOldProductModel(productModelDto.getModel(), productModelDto.getProductName()); } //存在就更新 if (oldProductModel != null) { oldProductModel.setModel(productModelDto.getModel()); src/main/java/com/ruoyi/production/service/impl/ProcessRouteServiceImpl.java
@@ -179,7 +179,7 @@ ProcessRouteItem item = new ProcessRouteItem(); item.setRouteId(routeId); item.setProcessId(dto.getProcessId()); item.setProductModelId(dto.getProductModelId()); item.setProductModelId(productModelId); item.setProcessRouteName(dto.getProcessRouteName()); item.setProcessRouteOpenNum(dto.getProcessRouteOpenNum()); item.setProcessRouteNum(dto.getProcessRouteNum()); @@ -229,8 +229,7 @@ ProductWorkOrder productWorkOrder = new ProductWorkOrder(); productWorkOrder.setProductProcessRouteItemId(item.getId()); productWorkOrder.setProductOrderId(productOrderId); ProductOrder order = productOrderMapper.selectById(productOrderId); productWorkOrder.setPlanQuantity(order.getQuantity()); productWorkOrder.setPlanQuantity(new BigDecimal(dto.getProcessRouteNum())); productWorkOrder.setDeviceId(dto.getDeviceId()); productWorkOrder.setUserIds(dto.getUserIds()); productWorkOrder.setUserNames(dto.getUserNames()); src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java
@@ -160,8 +160,13 @@ productionProductMain.setAuditUserId(dto.getAuditUserId()); productionProductMain.setAuditUserName(dto.getAuditUserName()); productionProductMain.setStatus(0); productionProductMain.setStartTime(productWorkOrder.getStartProductTime()); productionProductMain.setEndTime(now); if (ObjectUtils.isNotEmpty(dto.getStartTime())&&ObjectUtils.isNotEmpty(dto.getEndTime())) { productionProductMain.setStartTime(dto.getStartTime()); productionProductMain.setEndTime(dto.getEndTime()); }else { productionProductMain.setStartTime(productWorkOrder.getStartProductTime()); productionProductMain.setEndTime(now); } productionProductMain.setDeviceId(productProcess.getDeviceId()); productionProductMain.setDeviceName(productProcess.getDeviceName()); productionProductMainMapper.insert(productionProductMain); src/main/java/com/ruoyi/production/service/impl/SalesLedgerProductionAccountingServiceImpl.java
@@ -50,10 +50,9 @@ @Override public IPage<SalesLedgerProductionAccountingDto> pageProductionAccounting(SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto, Page page) { // TODO 管理员查询所有,其他人只能查自己 boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId()); if (!admin) { salesLedgerProductionAccountingDto.setSchedulingUserName(SecurityUtils.getUsername()); salesLedgerProductionAccountingDto.setSchedulingUserName(SecurityUtils.getLoginUser().getNickName()); } if (salesLedgerProductionAccountingDto.getDateType().equals("month")) { salesLedgerProductionAccountingDto.setEntryDate(null); src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.basic.dto.ProductModelAnticlockwiseDto; import com.ruoyi.basic.service.IProductModelService; import com.ruoyi.common.enums.StockInUnQualifiedRecordTypeEnum; import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum; import com.ruoyi.framework.web.domain.R; @@ -85,6 +87,8 @@ private StockInventoryMapper stockInventoryMapper; @Autowired private ProductOrderServiceImpl productOrderServiceImpl; @Autowired private IProductModelService productModelService; @Override public SalesLedgerProduct selectSalesLedgerProductById(Long id) { @@ -195,6 +199,16 @@ @Override @Transactional(rollbackFor = Exception.class) public int addOrUpdateSalesLedgerProduct(SalesLedgerProduct salesLedgerProduct) { //先查询基础表有没有 ProductModelAnticlockwiseDto productModelAnticlockwiseDto = new ProductModelAnticlockwiseDto(); productModelAnticlockwiseDto.setProductName(salesLedgerProduct.getProductCategory()); productModelAnticlockwiseDto.setModel(salesLedgerProduct.getSpecificationModel()); productModelAnticlockwiseDto.setUnit(salesLedgerProduct.getUnit()); productModelAnticlockwiseDto.setSubUnit(salesLedgerProduct.getUnit()); productModelAnticlockwiseDto.setId(salesLedgerProduct.getId()); Long l = productModelService.productModelAnticlockwise(productModelAnticlockwiseDto); salesLedgerProduct.setProductModelId(l); // 待回款,付款 if (salesLedgerProduct.getType().equals(1)) { salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProduct.getTaxInclusiveTotalPrice().subtract(salesLedgerProduct.getInvoiceTotal())); src/main/resources/mapper/production/ProductOrderMapper.xml
@@ -86,7 +86,10 @@ p.product_name, pp.name as process_name, pm.product_id, pm.model pm.model, ps.process_route_open_num, ps.process_route_num, ps.process_route_add_num from product_structure ps left join product_model pm on ps.product_model_id = pm.id