Merge remote-tracking branch 'origin/master' into master
正在显示
15 个修改的文件
包含
239 行增加
和
50 行删除
... | @@ -49,25 +49,24 @@ public class ErpSettlementController { | ... | @@ -49,25 +49,24 @@ public class ErpSettlementController { |
49 | @AutoLog(value = "药剂结算单详情-分页列表查询") | 49 | @AutoLog(value = "药剂结算单详情-分页列表查询") |
50 | @ApiOperation(value="药剂结算单详情-分页列表查询(settlementType = 0 供应商结算集合,settlementType= 1 水厂结算)", notes="药剂结算单详情-分页列表查询") | 50 | @ApiOperation(value="药剂结算单详情-分页列表查询(settlementType = 0 供应商结算集合,settlementType= 1 水厂结算)", notes="药剂结算单详情-分页列表查询") |
51 | @GetMapping(value = "/list") | 51 | @GetMapping(value = "/list") |
52 | public Result<IPage<ErpSettlement>> queryPageList(ErpSettlementSearchVO erpSettlementSearchVO, | 52 | public Result<IPage<ErpSettlement>> queryPageList(ErpSettlement erpSettlement, |
53 | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | 53 | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
54 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | 54 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
55 | HttpServletRequest req) { | 55 | HttpServletRequest req) { |
56 | Result<IPage<ErpSettlement>> result = new Result<IPage<ErpSettlement>>(); | 56 | Result<IPage<ErpSettlement>> result = new Result<IPage<ErpSettlement>>(); |
57 | QueryWrapper<ErpSettlement> queryWrapper = new QueryWrapper();// QueryGenerator.initQueryWrapper(erpSettlement, req.getParameterMap()); | 57 | QueryWrapper<ErpSettlement> queryWrapper = QueryGenerator.initQueryWrapper(erpSettlement, req.getParameterMap()); |
58 | Page<ErpSettlement> page = new Page<ErpSettlement>(pageNo, pageSize); | 58 | Page<ErpSettlement> page = new Page<ErpSettlement>(pageNo, pageSize); |
59 | //水务公司 | 59 | //水务公司 |
60 | if(StringUtils.isNotEmpty(erpSettlementSearchVO.getDepartId())){ | 60 | if(StringUtils.isNotEmpty(erpSettlement.getDepartId())){ |
61 | queryWrapper.eq("depart_id" ,erpSettlementSearchVO.getDepartId()) ; | 61 | queryWrapper.eq("depart_id" ,erpSettlement.getDepartId()) ; |
62 | } | 62 | } |
63 | //供应商 | 63 | //供应商 |
64 | if(StringUtils.isNotEmpty(erpSettlementSearchVO.getSupplierId())){ | 64 | if(StringUtils.isNotEmpty(erpSettlement.getSupplierId())){ |
65 | queryWrapper.eq("supplier_id" ,erpSettlementSearchVO.getSupplierId()) ; | 65 | queryWrapper.eq("supplier_id" ,erpSettlement.getSupplierId()) ; |
66 | } | 66 | } |
67 | //结算类型 | 67 | //结算类型 |
68 | queryWrapper.eq("settlement_type" ,erpSettlementSearchVO.getSettlementType()) ; | 68 | queryWrapper.eq("settlement_type" ,erpSettlement.getSettlementType()) ; |
69 | 69 | /*String startDate = req.getParameter("startDate"); | |
70 | String startDate = req.getParameter("startDate"); | ||
71 | if(StringUtils.isNotEmpty(startDate)){ | 70 | if(StringUtils.isNotEmpty(startDate)){ |
72 | startDate = startDate+" 00:00:00"; | 71 | startDate = startDate+" 00:00:00"; |
73 | queryWrapper.ge("settlement_time",startDate); | 72 | queryWrapper.ge("settlement_time",startDate); |
... | @@ -76,8 +75,13 @@ public class ErpSettlementController { | ... | @@ -76,8 +75,13 @@ public class ErpSettlementController { |
76 | if(StringUtils.isNotEmpty(endDate)){ | 75 | if(StringUtils.isNotEmpty(endDate)){ |
77 | endDate = endDate+" 23:59:59"; | 76 | endDate = endDate+" 23:59:59"; |
78 | queryWrapper.le("settlement_time",endDate ); | 77 | queryWrapper.le("settlement_time",endDate ); |
78 | }*/ | ||
79 | IPage<ErpSettlement> pageList = null; | ||
80 | if("0".equals(erpSettlement.getSettlementType())){ | ||
81 | pageList = erpSettlementService.querySettlementPageBySupplier(page, queryWrapper); | ||
82 | }else{ | ||
83 | pageList = erpSettlementService.page(page, queryWrapper); | ||
79 | } | 84 | } |
80 | IPage<ErpSettlement> pageList = erpSettlementService.page(page, queryWrapper); | ||
81 | result.setSuccess(true); | 85 | result.setSuccess(true); |
82 | result.setResult(pageList); | 86 | result.setResult(pageList); |
83 | return result; | 87 | return result; |
... | @@ -105,6 +109,7 @@ public class ErpSettlementController { | ... | @@ -105,6 +109,7 @@ public class ErpSettlementController { |
105 | for(ErpSettlementVO settlementVO : settlementVOList){ | 109 | for(ErpSettlementVO settlementVO : settlementVOList){ |
106 | erpSettlementVO = settlementVO; | 110 | erpSettlementVO = settlementVO; |
107 | erpSettlementVO.setSettlementType("0"); | 111 | erpSettlementVO.setSettlementType("0"); |
112 | |||
108 | if(supplierName.length() >0 ) supplierName+=","; | 113 | if(supplierName.length() >0 ) supplierName+=","; |
109 | supplierName += ConvertUtils.getString(settlementVO.getSupplierName(),""); | 114 | supplierName += ConvertUtils.getString(settlementVO.getSupplierName(),""); |
110 | contractCode += settlementVO.getContractCode(); | 115 | contractCode += settlementVO.getContractCode(); |
... | @@ -244,14 +249,36 @@ public class ErpSettlementController { | ... | @@ -244,14 +249,36 @@ public class ErpSettlementController { |
244 | } | 249 | } |
245 | return result; | 250 | return result; |
246 | } | 251 | } |
252 | |||
253 | @AutoLog(value = "药剂结算单详情-审批") | ||
254 | @ApiOperation(value="药剂结算单详情-审批", notes="药剂结算单详情-审批") | ||
255 | @GetMapping(value = "/audit") | ||
256 | public Result<?> audit(@RequestParam(name="id",required=true) String id,Integer auditStatus ,String approveMessage ) { | ||
257 | Result<ErpSettlementVO> result = new Result<ErpSettlementVO>(); | ||
258 | ErpSettlement erpSettlementEntity = erpSettlementService.getById(id); | ||
259 | erpSettlementEntity.setInspectTime(DateUtils.format(new Date(), HolidaysUtils.DATE_TIME_PATTERN)); | ||
260 | erpSettlementEntity.setAuditStatus(auditStatus); | ||
261 | erpSettlementEntity.setApproveMessage(approveMessage); | ||
262 | erpSettlementEntity.setInspectorSign(BaseContextHandler.getUserName()); | ||
263 | if(erpSettlementEntity==null) { | ||
264 | result.error500("未找到对应实体"); | ||
265 | }else { | ||
266 | boolean ok = erpSettlementService.auditAccept(erpSettlementEntity); | ||
267 | if(ok) { | ||
268 | result.success("操作成功!"); | ||
269 | } | ||
270 | } | ||
271 | return result; | ||
272 | } | ||
247 | @AutoLog(value = "药剂结算单详情-验收审批") | 273 | @AutoLog(value = "药剂结算单详情-验收审批") |
248 | @ApiOperation(value="药剂结算单详情-验收审批", notes="药剂结算单详情-验收审批") | 274 | @ApiOperation(value="药剂结算单详情-验收审批", notes="药剂结算单详情-验收审批") |
249 | @GetMapping(value = "/auditAccept") | 275 | @GetMapping(value = "/auditAccept") |
250 | public Result<?> auditAccept(@RequestParam(name="id",required=true) String id) { | 276 | public Result<?> auditAccept(@RequestParam(name="id",required=true) String id,Integer auditStatus ,String approveMessage ) { |
251 | Result<ErpSettlementVO> result = new Result<ErpSettlementVO>(); | 277 | Result<ErpSettlementVO> result = new Result<ErpSettlementVO>(); |
252 | ErpSettlement erpSettlementEntity = erpSettlementService.getById(id); | 278 | ErpSettlement erpSettlementEntity = erpSettlementService.getById(id); |
253 | erpSettlementEntity.setInspectTime(DateUtils.format(new Date(), HolidaysUtils.DATE_TIME_PATTERN)); | 279 | erpSettlementEntity.setInspectTime(DateUtils.format(new Date(), HolidaysUtils.DATE_TIME_PATTERN)); |
254 | erpSettlementEntity.setAuditStatus(2); | 280 | erpSettlementEntity.setAuditStatus(auditStatus); |
281 | erpSettlementEntity.setApproveMessage(approveMessage); | ||
255 | erpSettlementEntity.setInspectorSign(BaseContextHandler.getUserName()); | 282 | erpSettlementEntity.setInspectorSign(BaseContextHandler.getUserName()); |
256 | if(erpSettlementEntity==null) { | 283 | if(erpSettlementEntity==null) { |
257 | result.error500("未找到对应实体"); | 284 | result.error500("未找到对应实体"); |
... | @@ -267,12 +294,13 @@ public class ErpSettlementController { | ... | @@ -267,12 +294,13 @@ public class ErpSettlementController { |
267 | @AutoLog(value = "药剂结算单详情-经理审批") | 294 | @AutoLog(value = "药剂结算单详情-经理审批") |
268 | @ApiOperation(value="药剂结算单详情-经理审批", notes="药剂结算单详情-经理审批") | 295 | @ApiOperation(value="药剂结算单详情-经理审批", notes="药剂结算单详情-经理审批") |
269 | @GetMapping(value = "/auditManager") | 296 | @GetMapping(value = "/auditManager") |
270 | public Result<?> auditManager(@RequestParam(name="id",required=true) String id) { | 297 | public Result<?> auditManager(@RequestParam(name="id",required=true) String id,Integer auditStatus ,String approveMessage ) { |
271 | Result<ErpSettlementVO> result = new Result<ErpSettlementVO>(); | 298 | Result<ErpSettlementVO> result = new Result<ErpSettlementVO>(); |
272 | ErpSettlement erpSettlementEntity = erpSettlementService.getById(id); | 299 | ErpSettlement erpSettlementEntity = erpSettlementService.getById(id); |
273 | erpSettlementEntity.setApproveTime(DateUtils.format(new Date(), HolidaysUtils.DATE_TIME_PATTERN)); | 300 | erpSettlementEntity.setApproveTime(DateUtils.format(new Date(), HolidaysUtils.DATE_TIME_PATTERN)); |
274 | erpSettlementEntity.setApproverSign(BaseContextHandler.getUserName()); | 301 | erpSettlementEntity.setApproverSign(BaseContextHandler.getUserName()); |
275 | erpSettlementEntity.setAuditStatus(3); | 302 | erpSettlementEntity.setAuditStatus(auditStatus); |
303 | erpSettlementEntity.setApproveMessage(approveMessage); | ||
276 | if(erpSettlementEntity==null) { | 304 | if(erpSettlementEntity==null) { |
277 | result.error500("未找到对应实体"); | 305 | result.error500("未找到对应实体"); |
278 | }else { | 306 | }else { | ... | ... |
... | @@ -31,10 +31,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ... | @@ -31,10 +31,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
31 | import com.baomidou.mybatisplus.core.metadata.IPage; | 31 | import com.baomidou.mybatisplus.core.metadata.IPage; |
32 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 32 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
33 | import com.skua.modules.erp.util.PdfUtil; | 33 | import com.skua.modules.erp.util.PdfUtil; |
34 | import com.skua.modules.erp.vo.ArrivalRecordExcelExportVO; | 34 | import com.skua.modules.erp.vo.*; |
35 | import com.skua.modules.erp.vo.MaterialINArrivalRecordVO; | ||
36 | import com.skua.modules.erp.vo.MaterialINVO; | ||
37 | import com.skua.modules.erp.vo.MaterialINXslVO; | ||
38 | import com.skua.modules.supplies.entity.EquipmentSparepartSupplies; | 35 | import com.skua.modules.supplies.entity.EquipmentSparepartSupplies; |
39 | import com.skua.modules.supplies.entity.EquipmentSparepartType; | 36 | import com.skua.modules.supplies.entity.EquipmentSparepartType; |
40 | import com.skua.modules.supplies.service.IEquipmentSparepartSuppliesService; | 37 | import com.skua.modules.supplies.service.IEquipmentSparepartSuppliesService; |
... | @@ -179,6 +176,7 @@ public class MaterialINController { | ... | @@ -179,6 +176,7 @@ public class MaterialINController { |
179 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | 176 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
180 | HttpServletRequest req) { | 177 | HttpServletRequest req) { |
181 | Result<IPage<MaterialINVO>> result = new Result<IPage<MaterialINVO>>(); | 178 | Result<IPage<MaterialINVO>> result = new Result<IPage<MaterialINVO>>(); |
179 | |||
182 | /*QueryWrapper<MaterialIN> queryWrapper = QueryGenerator.initQueryWrapper(materialIN, req.getParameterMap()); | 180 | /*QueryWrapper<MaterialIN> queryWrapper = QueryGenerator.initQueryWrapper(materialIN, req.getParameterMap()); |
183 | 181 | ||
184 | queryWrapper.eq("audit_status","3");//审批通过 | 182 | queryWrapper.eq("audit_status","3");//审批通过 |
... | @@ -286,8 +284,6 @@ public class MaterialINController { | ... | @@ -286,8 +284,6 @@ public class MaterialINController { |
286 | Result<MaterialINVO> result = new Result<MaterialINVO>(); | 284 | Result<MaterialINVO> result = new Result<MaterialINVO>(); |
287 | MaterialINVO materialIN = materialINService.queryById(id); | 285 | MaterialINVO materialIN = materialINService.queryById(id); |
288 | /**/ | 286 | /**/ |
289 | |||
290 | |||
291 | if(materialIN==null) { | 287 | if(materialIN==null) { |
292 | result.error500("未找到对应实体"); | 288 | result.error500("未找到对应实体"); |
293 | }else { | 289 | }else { |
... | @@ -374,6 +370,23 @@ public class MaterialINController { | ... | @@ -374,6 +370,23 @@ public class MaterialINController { |
374 | } | 370 | } |
375 | return result; | 371 | return result; |
376 | } | 372 | } |
373 | |||
374 | @AutoLog(value = "erp--药剂入库-回退") | ||
375 | @ApiOperation(value="erp--药剂入库-回退", notes="erp--药剂入库-回退") | ||
376 | @PutMapping(value = "/rollback") | ||
377 | public Result<MaterialIN> rollback(ApprovalRecordVO approvalRecordVO) { | ||
378 | Result<MaterialIN> result = new Result<MaterialIN>(); | ||
379 | MaterialIN materialIN = null; | ||
380 | result.setSuccess(true);//默认成功! | ||
381 | String errMsg = materialINService.rollback(approvalRecordVO); | ||
382 | result.setResult(materialIN); | ||
383 | |||
384 | if(errMsg != null ){ | ||
385 | result.error500(errMsg); | ||
386 | } | ||
387 | |||
388 | return result; | ||
389 | } | ||
377 | /** | 390 | /** |
378 | * <pre> | 391 | * <pre> |
379 | * 导出excel | 392 | * 导出excel |
... | @@ -403,18 +416,33 @@ public class MaterialINController { | ... | @@ -403,18 +416,33 @@ public class MaterialINController { |
403 | } | 416 | } |
404 | //导出到货记录 | 417 | //导出到货记录 |
405 | @RequestMapping(value = "/exportArrivalRecord") | 418 | @RequestMapping(value = "/exportArrivalRecord") |
406 | public ModelAndView exportArrivalRecord(MaterialIN materialIN,HttpServletRequest request, HttpServletResponse response) { | 419 | public ModelAndView exportArrivalRecord(MaterialINVO materialINVO,HttpServletRequest request, HttpServletResponse response) { |
407 | // Step.1 组装查询条件 | 420 | // Step.1 组装查询条件 |
408 | QueryWrapper<MaterialIN> queryWrapper = null; | 421 | // QueryWrapper<MaterialIN> queryWrapper = null; |
409 | queryWrapper = QueryGenerator.initQueryWrapper(materialIN, request.getParameterMap()); | 422 | // queryWrapper = QueryGenerator.initQueryWrapper(materialIN, request.getParameterMap()); |
410 | //全部确认的数据 | 423 | //全部确认的数据 |
411 | //queryWrapper.eq("confirm_status","9"); | 424 | //queryWrapper.eq("confirm_status","9"); |
412 | queryWrapper.eq("audit_status","3"); | 425 | //queryWrapper.eq("audit_status","3"); |
413 | queryWrapper.orderByDesc("arrive_time"); | 426 | // queryWrapper.orderByDesc("arrive_time"); |
427 | |||
428 | |||
429 | Page<MaterialINVO> page = new Page<MaterialINVO>(1, 10000); | ||
430 | if(StringUtils.isNotEmpty(request.getParameter("arriveTime_begin"))){ | ||
431 | materialINVO.setStartTime( request.getParameter("arriveTime_begin") ); | ||
432 | } | ||
433 | if(StringUtils.isNotEmpty(request.getParameter("arriveTime_end"))){ | ||
434 | materialINVO.setEndTime( request.getParameter("arriveTime_end") ); | ||
435 | } | ||
436 | if(StringUtils.isEmpty(materialINVO.getDepartId())){ | ||
437 | materialINVO.setDepartIds( JSUtils.quoteEach( BaseContextHandler.getDeparts(),",")); | ||
438 | } | ||
439 | |||
440 | materialINVO.setAuditStatus("3"); | ||
441 | IPage<MaterialINVO> pageList = materialINService.arrivalRecordList(page, materialINVO); | ||
414 | 442 | ||
415 | //Step.2 AutoPoi 导出Excel | 443 | //Step.2 AutoPoi 导出Excel |
416 | ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); | 444 | ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); |
417 | List<MaterialIN> materialINList = materialINService.list(queryWrapper); | 445 | List<MaterialINVO> materialINList = pageList.getRecords(); |
418 | 446 | ||
419 | List<MaterialINArrivalRecordVO> dataList = new ArrayList<>(); | 447 | List<MaterialINArrivalRecordVO> dataList = new ArrayList<>(); |
420 | MaterialINArrivalRecordVO arrivalRecordVO = null; | 448 | MaterialINArrivalRecordVO arrivalRecordVO = null; |
... | @@ -429,7 +457,6 @@ public class MaterialINController { | ... | @@ -429,7 +457,6 @@ public class MaterialINController { |
429 | dataList.add( arrivalRecordVO ) ; | 457 | dataList.add( arrivalRecordVO ) ; |
430 | } | 458 | } |
431 | } | 459 | } |
432 | |||
433 | //导出文件名称 | 460 | //导出文件名称 |
434 | mv.addObject(NormalExcelConstants.FILE_NAME, "药剂到货验收记录表"); | 461 | mv.addObject(NormalExcelConstants.FILE_NAME, "药剂到货验收记录表"); |
435 | mv.addObject(NormalExcelConstants.CLASS, MaterialINArrivalRecordVO.class); | 462 | mv.addObject(NormalExcelConstants.CLASS, MaterialINArrivalRecordVO.class); | ... | ... |
... | @@ -62,7 +62,7 @@ public class ErpSettlement { | ... | @@ -62,7 +62,7 @@ public class ErpSettlement { |
62 | private String totalPriceTax; | 62 | private String totalPriceTax; |
63 | /**签字状态(1-申请,2-验收签字,3-经理签字)*/ | 63 | /**签字状态(1-申请,2-验收签字,3-经理签字)*/ |
64 | @Excel(name = "签字状态(1-申请,2-验收签字,3-经理签字)", width = 15) | 64 | @Excel(name = "签字状态(1-申请,2-验收签字,3-经理签字)", width = 15) |
65 | @ApiModelProperty(value = "审批状态(1-申请,2-验收签字,3-经理签字)") | 65 | @ApiModelProperty(value = "审批状态(1-申请,2-验收签字,3-经理签字,4 验收驳回,5 经理驳回)") |
66 | private Integer auditStatus; | 66 | private Integer auditStatus; |
67 | /**结算状态(0 未结算 1 已结算)*/ | 67 | /**结算状态(0 未结算 1 已结算)*/ |
68 | @Excel(name = "结算状态(0 未结算 1 已结算)", width = 15) | 68 | @Excel(name = "结算状态(0 未结算 1 已结算)", width = 15) |
... | @@ -103,6 +103,9 @@ public class ErpSettlement { | ... | @@ -103,6 +103,9 @@ public class ErpSettlement { |
103 | 103 | ||
104 | @ApiModelProperty(value = "结束时间") | 104 | @ApiModelProperty(value = "结束时间") |
105 | private String endDate; | 105 | private String endDate; |
106 | |||
107 | @ApiModelProperty(value = "审批意见") | ||
108 | private String approveMessage; | ||
106 | /**备注*/ | 109 | /**备注*/ |
107 | @Excel(name = "备注", width = 15) | 110 | @Excel(name = "备注", width = 15) |
108 | @ApiModelProperty(value = "备注") | 111 | @ApiModelProperty(value = "备注") | ... | ... |
... | @@ -78,7 +78,10 @@ public class MaterialIN { | ... | @@ -78,7 +78,10 @@ public class MaterialIN { |
78 | @ApiModelProperty(value = "物料编号") | 78 | @ApiModelProperty(value = "物料编号") |
79 | @Dict(dictTable = "equipment_sparepart_supplies", dicCode="id", dicText = "sparepart_name") | 79 | @Dict(dictTable = "equipment_sparepart_supplies", dicCode="id", dicText = "sparepart_name") |
80 | private String sparepartId; | 80 | private String sparepartId; |
81 | 81 | /**药剂(物料)名称*/ | |
82 | @Excel(name = "药剂(物料)名称", width = 15) | ||
83 | @ApiModelProperty(value = "药剂(物料)名称") | ||
84 | private String sparepartName; | ||
82 | 85 | ||
83 | @Excel(name = "入库仓库", width = 15,dictTable = "supplies_warehouse", dicCode="id", dicText = "warehouse_name") | 86 | @Excel(name = "入库仓库", width = 15,dictTable = "supplies_warehouse", dicCode="id", dicText = "warehouse_name") |
84 | @ApiModelProperty(value = "入库仓库") | 87 | @ApiModelProperty(value = "入库仓库") | ... | ... |
... | @@ -2,6 +2,10 @@ package com.skua.modules.erp.mapper; | ... | @@ -2,6 +2,10 @@ package com.skua.modules.erp.mapper; |
2 | 2 | ||
3 | import java.util.List; | 3 | import java.util.List; |
4 | 4 | ||
5 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
6 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
7 | import com.baomidou.mybatisplus.core.toolkit.Constants; | ||
8 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
5 | import com.skua.modules.erp.entity.ErpSettlementItem; | 9 | import com.skua.modules.erp.entity.ErpSettlementItem; |
6 | import com.skua.modules.erp.vo.ErpSettlementItemVO; | 10 | import com.skua.modules.erp.vo.ErpSettlementItemVO; |
7 | import com.skua.modules.erp.vo.ErpSettlementVO; | 11 | import com.skua.modules.erp.vo.ErpSettlementVO; |
... | @@ -9,6 +13,7 @@ import com.skua.tool.annotation.Anonymous; | ... | @@ -9,6 +13,7 @@ import com.skua.tool.annotation.Anonymous; |
9 | import org.apache.ibatis.annotations.Param; | 13 | import org.apache.ibatis.annotations.Param; |
10 | import com.skua.modules.erp.entity.ErpSettlement; | 14 | import com.skua.modules.erp.entity.ErpSettlement; |
11 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 15 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
16 | import org.apache.ibatis.annotations.Select; | ||
12 | 17 | ||
13 | /** | 18 | /** |
14 | * 药剂结算单详情 | 19 | * 药剂结算单详情 |
... | @@ -26,6 +31,10 @@ public interface ErpSettlementMapper extends BaseMapper<ErpSettlement> { | ... | @@ -26,6 +31,10 @@ public interface ErpSettlementMapper extends BaseMapper<ErpSettlement> { |
26 | // 根据入库单ids,获取【水厂】结算单详情 | 31 | // 根据入库单ids,获取【水厂】结算单详情 |
27 | @Anonymous | 32 | @Anonymous |
28 | List<ErpSettlementItemVO> queryWaterDepartSettlementByMaterialIds(@Param("ids") String materialIds); | 33 | List<ErpSettlementItemVO> queryWaterDepartSettlementByMaterialIds(@Param("ids") String materialIds); |
34 | //供应商结算分页列表 | ||
35 | @Anonymous | ||
36 | @Select("select * from erp_settlement ${ew.customSqlSegment}") | ||
37 | IPage<ErpSettlement> querySettlementPageBySupplier(Page<ErpSettlement> page, @Param(Constants.WRAPPER) QueryWrapper<ErpSettlement> queryWrapper); | ||
29 | //(供应商)送货单以及物资验收单 | 38 | //(供应商)送货单以及物资验收单 |
30 | /// List<ErpSettlementItemVO> querySupplierSettlementFormById(@Param("id")String id); | 39 | /// List<ErpSettlementItemVO> querySupplierSettlementFormById(@Param("id")String id); |
31 | //(水厂) 送货单以及物资验收单 | 40 | //(水厂) 送货单以及物资验收单 | ... | ... |
... | @@ -13,7 +13,8 @@ | ... | @@ -13,7 +13,8 @@ |
13 | si.id,si.settlement_id,si.depart_id,si.material_in_id,si.purchase_contract_id,si.distribut_contract_id,si.sparepart_id,si.material_num,si.arrive_time,si.good_code, | 13 | si.id,si.settlement_id,si.depart_id,si.material_in_id,si.purchase_contract_id,si.distribut_contract_id,si.sparepart_id,si.material_num,si.arrive_time,si.good_code, |
14 | round(pm.unit_price * si.material_num,2)'total_price',round(pm.unit_price * si.material_num *100 /(100+ ifnull(pm.tax_amount,0)) ,2) total_price_tax | 14 | round(pm.unit_price * si.material_num,2)'total_price',round(pm.unit_price * si.material_num *100 /(100+ ifnull(pm.tax_amount,0)) ,2) total_price_tax |
15 | from erp_settlement_item si | 15 | from erp_settlement_item si |
16 | left join sys_depart d on d.id = si.depart_id | 16 | left join erp_material_in mi on mi.id = si.material_in_id |
17 | left join sys_depart d on d.id = mi.depart_id | ||
17 | left join erp_purchase_material pm on (pm.contract_id =si.purchase_contract_id and pm.good_code = si.good_code ) | 18 | left join erp_purchase_material pm on (pm.contract_id =si.purchase_contract_id and pm.good_code = si.good_code ) |
18 | left join equipment_sparepart_supplies ss on si.sparepart_id = ss.id | 19 | left join equipment_sparepart_supplies ss on si.sparepart_id = ss.id |
19 | left join erp_material_acceptance_form mf on mf.id = si.material_in_id | 20 | left join erp_material_acceptance_form mf on mf.id = si.material_in_id |
... | @@ -29,7 +30,8 @@ | ... | @@ -29,7 +30,8 @@ |
29 | si.id,si.settlement_id,si.depart_id,si.material_in_id,si.distribut_contract_id,si.purchase_contract_id,si.sparepart_id,si.material_num,si.arrive_time,si.good_code, | 30 | si.id,si.settlement_id,si.depart_id,si.material_in_id,si.distribut_contract_id,si.purchase_contract_id,si.sparepart_id,si.material_num,si.arrive_time,si.good_code, |
30 | round(dm.distribut_price * si.material_num,2)'total_price',round(dm.distribut_price * si.material_num *100 /(100+ ifnull(dm.tax_amount,0)) ,2) total_price_tax | 31 | round(dm.distribut_price * si.material_num,2)'total_price',round(dm.distribut_price * si.material_num *100 /(100+ ifnull(dm.tax_amount,0)) ,2) total_price_tax |
31 | from erp_settlement_item si | 32 | from erp_settlement_item si |
32 | left join sys_depart d on d.id = si.depart_id | 33 | left join erp_material_in mi on mi.id = si.material_in_id |
34 | left join sys_depart d on d.id = mi.depart_id | ||
33 | 35 | ||
34 | left join erp_material_acceptance_form mf on mf.id = si.material_in_id | 36 | left join erp_material_acceptance_form mf on mf.id = si.material_in_id |
35 | left join erp_distribut_contract dc on si.distribut_contract_id = dc.id | 37 | left join erp_distribut_contract dc on si.distribut_contract_id = dc.id | ... | ... |
1 | package com.skua.modules.erp.service; | 1 | package com.skua.modules.erp.service; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
4 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
3 | import com.skua.modules.erp.entity.ErpSettlement; | 6 | import com.skua.modules.erp.entity.ErpSettlement; |
4 | import com.baomidou.mybatisplus.extension.service.IService; | 7 | import com.baomidou.mybatisplus.extension.service.IService; |
5 | import com.skua.modules.erp.entity.ErpSettlementItem; | 8 | import com.skua.modules.erp.entity.ErpSettlementItem; |
... | @@ -53,6 +56,14 @@ public interface IErpSettlementService extends IService<ErpSettlement> { | ... | @@ -53,6 +56,14 @@ public interface IErpSettlementService extends IService<ErpSettlement> { |
53 | */ | 56 | */ |
54 | boolean auditAccept(ErpSettlement erpSettlementEntity); | 57 | boolean auditAccept(ErpSettlement erpSettlementEntity); |
55 | 58 | ||
59 | /*** | ||
60 | * 供应商结算分页列表 | ||
61 | * @param page | ||
62 | * @param queryWrapper | ||
63 | * @return | ||
64 | */ | ||
65 | IPage<ErpSettlement> querySettlementPageBySupplier(Page<ErpSettlement> page, QueryWrapper<ErpSettlement> queryWrapper); | ||
66 | |||
56 | // (供应商)送货单以及物资验收单 | 67 | // (供应商)送货单以及物资验收单 |
57 | // ErpSettlementFormVO querySupplierSettlementFormById(String id); | 68 | // ErpSettlementFormVO querySupplierSettlementFormById(String id); |
58 | //(水厂) 送货单以及物资验收单 | 69 | //(水厂) 送货单以及物资验收单 | ... | ... |
... | @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; | ... | @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
5 | import com.skua.modules.erp.entity.MaterialIN; | 5 | import com.skua.modules.erp.entity.MaterialIN; |
6 | import com.baomidou.mybatisplus.extension.service.IService; | 6 | import com.baomidou.mybatisplus.extension.service.IService; |
7 | import com.skua.modules.erp.vo.ApprovalRecordVO; | ||
7 | import com.skua.modules.erp.vo.ArrivalRecordExcelExportVO; | 8 | import com.skua.modules.erp.vo.ArrivalRecordExcelExportVO; |
8 | import com.skua.modules.erp.vo.MaterialINVO; | 9 | import com.skua.modules.erp.vo.MaterialINVO; |
9 | 10 | ||
... | @@ -73,5 +74,9 @@ public interface IMaterialINService extends IService<MaterialIN> { | ... | @@ -73,5 +74,9 @@ public interface IMaterialINService extends IService<MaterialIN> { |
73 | */ | 74 | */ |
74 | void sendAudit(MaterialIN materialIN); | 75 | void sendAudit(MaterialIN materialIN); |
75 | 76 | ||
76 | 77 | /*** | |
78 | * 回退 | ||
79 | * @param approvalRecordVO | ||
80 | */ | ||
81 | String rollback(ApprovalRecordVO approvalRecordVO); | ||
77 | } | 82 | } | ... | ... |
1 | package com.skua.modules.erp.service.impl; | 1 | package com.skua.modules.erp.service.impl; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
4 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
4 | import com.skua.modules.common.service.ICommonSqlService; | 6 | import com.skua.modules.common.service.ICommonSqlService; |
5 | import com.skua.modules.equipment.entity.SupplierManage; | 7 | import com.skua.modules.equipment.entity.SupplierManage; |
6 | import com.skua.modules.equipment.mapper.SupplierManageMapper; | 8 | import com.skua.modules.equipment.mapper.SupplierManageMapper; |
... | @@ -169,6 +171,16 @@ public class ErpSettlementServiceImpl extends ServiceImpl<ErpSettlementMapper, E | ... | @@ -169,6 +171,16 @@ public class ErpSettlementServiceImpl extends ServiceImpl<ErpSettlementMapper, E |
169 | public List<ErpSettlementVO> checkSettlementByWaterDepart(String materialInIds){ | 171 | public List<ErpSettlementVO> checkSettlementByWaterDepart(String materialInIds){ |
170 | return this.baseMapper.checkSettlementByWaterDepart( materialInIds ); | 172 | return this.baseMapper.checkSettlementByWaterDepart( materialInIds ); |
171 | } | 173 | } |
174 | |||
175 | /*** | ||
176 | * 供应商结算分页列表 | ||
177 | * @param page | ||
178 | * @param queryWrapper | ||
179 | * @return | ||
180 | */ | ||
181 | public IPage<ErpSettlement> querySettlementPageBySupplier(Page<ErpSettlement> page, QueryWrapper<ErpSettlement> queryWrapper){ | ||
182 | return this.baseMapper.querySettlementPageBySupplier( page ,queryWrapper); | ||
183 | } | ||
172 | /** | 184 | /** |
173 | * 结算单:验收审批 | 185 | * 结算单:验收审批 |
174 | * @param erpSettlementEntity | 186 | * @param erpSettlementEntity | ... | ... |
... | @@ -23,6 +23,7 @@ import com.skua.modules.erp.service.IERPPurchaseContractService; | ... | @@ -23,6 +23,7 @@ import com.skua.modules.erp.service.IERPPurchaseContractService; |
23 | import com.skua.modules.erp.service.IMaterialAcceptanceFormService; | 23 | import com.skua.modules.erp.service.IMaterialAcceptanceFormService; |
24 | import com.skua.modules.erp.service.IMaterialINService; | 24 | import com.skua.modules.erp.service.IMaterialINService; |
25 | import com.skua.modules.erp.service.IPurchaseMaterialService; | 25 | import com.skua.modules.erp.service.IPurchaseMaterialService; |
26 | import com.skua.modules.erp.vo.ApprovalRecordVO; | ||
26 | import com.skua.modules.erp.vo.ArrivalRecordExcelExportVO; | 27 | import com.skua.modules.erp.vo.ArrivalRecordExcelExportVO; |
27 | import com.skua.modules.erp.vo.MaterialINVO; | 28 | import com.skua.modules.erp.vo.MaterialINVO; |
28 | import com.skua.modules.erp.vo.PurchaseMaterialVO; | 29 | import com.skua.modules.erp.vo.PurchaseMaterialVO; |
... | @@ -59,8 +60,6 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia | ... | @@ -59,8 +60,6 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia |
59 | @Autowired | 60 | @Autowired |
60 | private IERPPurchaseContractService purchaseContractService; | 61 | private IERPPurchaseContractService purchaseContractService; |
61 | @Autowired | 62 | @Autowired |
62 | private IPurchaseMaterialService purchaseMaterialService; | ||
63 | @Autowired | ||
64 | private IEquipmentInService equipmentInService; | 63 | private IEquipmentInService equipmentInService; |
65 | @Autowired | 64 | @Autowired |
66 | private IEquipmentOutService equipmentOutService; | 65 | private IEquipmentOutService equipmentOutService; |
... | @@ -71,6 +70,8 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia | ... | @@ -71,6 +70,8 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia |
71 | private SmsService smsService; | 70 | private SmsService smsService; |
72 | @Autowired | 71 | @Autowired |
73 | private ISysConfigService configService; | 72 | private ISysConfigService configService; |
73 | @Autowired | ||
74 | private ICommonSqlService commonSqlService; | ||
74 | 75 | ||
75 | 76 | ||
76 | /*** | 77 | /*** |
... | @@ -117,12 +118,54 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia | ... | @@ -117,12 +118,54 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia |
117 | smsService.pushMsgNoProcessByRoleId("药剂入库审批","有药剂入库单["+materialIN.getProjectName()+"]需要审批审批",roleId,"MaterialIN",msgCategory); | 118 | smsService.pushMsgNoProcessByRoleId("药剂入库审批","有药剂入库单["+materialIN.getProjectName()+"]需要审批审批",roleId,"MaterialIN",msgCategory); |
118 | } | 119 | } |
119 | /*** | 120 | /*** |
121 | * 回退 | ||
122 | * @param approvalRecordVO | ||
123 | */ | ||
124 | @Transactional | ||
125 | public String rollback(ApprovalRecordVO approvalRecordVO){ | ||
126 | MaterialIN materialIN = this.getById(approvalRecordVO.getId()); | ||
127 | |||
128 | if(0 != materialIN.getSupplierSettlementFlag()){ | ||
129 | return "已申请供应商结算,不能回退!"; | ||
130 | } | ||
131 | if(0 != materialIN.getWaterDepartSettlementFlag() ){ | ||
132 | return "已申请水厂结算,不能回退!"; | ||
133 | } | ||
134 | // 审核通过,生成入库单据、物料单 | ||
135 | materialIN.setAuditStatus(approvalRecordVO.getAuditStatus()); | ||
136 | materialIN.setApproveMessage(approvalRecordVO.getApproveMessage());//审批意见 | ||
137 | this.baseMapper.updateById( materialIN ) ; | ||
138 | //审批记录 | ||
139 | //ApproveRecord record = new ApproveRecord( "YJIN", materialIN.getApplyUser(), materialIN.getId(), BaseContextHandler.getUserId(), approvalRecordVO.getApproveMessage(), approvalRecordVO.getAuditStatus()); | ||
140 | // recordMapper.insert( record ) ; | ||
141 | // 回退出库 | ||
142 | String sql = null; | ||
143 | if(StringUtils.isNotEmpty(materialIN.getEquipmentOutId())){ | ||
144 | sql = "update equipment_sparepart es , equipment_out eo , equipment_out_child eoc set es.storage_num = (es.storage_num + eoc.out_num) where eo.id = eoc.out_id and es.supplies_id = eoc.sparepart_id and es.supplies_warehouse_id = eo.supplies_warehouse_id"; | ||
145 | sql += " and eo.id = '"+materialIN.getEquipmentOutId()+"'"; | ||
146 | commonSqlService.update(sql); | ||
147 | } | ||
148 | //回退入库 | ||
149 | if(StringUtils.isNotEmpty(materialIN.getEquipmentInId())){ | ||
150 | sql = "update equipment_sparepart es , equipment_in ei , equipment_in_child eic set es.storage_num = (es.storage_num - eic.in_num) where ei.id = eic.in_id and es.supplies_id = eic.sparepart_id and es.supplies_warehouse_id = ei.supplies_warehouse_id"; | ||
151 | sql += " and ei.id = '"+materialIN.getEquipmentInId()+"'"; | ||
152 | commonSqlService.update(sql); | ||
153 | } | ||
154 | //处理特殊情况,库存不能为负值 | ||
155 | if(StringUtils.isNotEmpty(materialIN.getEquipmentOutId()) || StringUtils.isNotEmpty(materialIN.getEquipmentInId())){ | ||
156 | sql = "update equipment_sparepart set storage_num = 0 where storage_num<0"; | ||
157 | commonSqlService.update(sql); | ||
158 | } | ||
159 | |||
160 | |||
161 | return null; | ||
162 | } | ||
163 | /*** | ||
120 | * 审核药剂入库单 | 164 | * 审核药剂入库单 |
121 | * @param materialINVO | 165 | * @param materialINVO |
122 | */ | 166 | */ |
123 | @Transactional | 167 | @Transactional |
124 | public String auditMaterialINVO(MaterialINVO materialINVO)throws Exception { | 168 | public String auditMaterialINVO(MaterialINVO materialINVO)throws Exception { |
125 | boolean inAndOutStock = false; | ||
126 | String errMsg = auditMaterialIn(materialINVO.getId(),materialINVO.getApproveState(),materialINVO.getApproveMessage()); | 169 | String errMsg = auditMaterialIn(materialINVO.getId(),materialINVO.getApproveState(),materialINVO.getApproveMessage()); |
127 | return errMsg; | 170 | return errMsg; |
128 | } | 171 | } |
... | @@ -236,6 +279,7 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia | ... | @@ -236,6 +279,7 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia |
236 | materialIN.setMaterialNum(purchaseMaterialVO.getMaterialNum()); | 279 | materialIN.setMaterialNum(purchaseMaterialVO.getMaterialNum()); |
237 | 280 | ||
238 | materialIN.setSparepartId(purchaseMaterialVO.getSparepartId()); | 281 | materialIN.setSparepartId(purchaseMaterialVO.getSparepartId()); |
282 | |||
239 | materialIN.setSparepartType(purchaseMaterialVO.getSparepartType()); | 283 | materialIN.setSparepartType(purchaseMaterialVO.getSparepartType()); |
240 | materialIN.setGoodCode(purchaseMaterialVO.getGoodCode()); | 284 | materialIN.setGoodCode(purchaseMaterialVO.getGoodCode()); |
241 | materialIN.setSupplierId(purchaseMaterialVO.getSupplierId()); | 285 | materialIN.setSupplierId(purchaseMaterialVO.getSupplierId()); |
... | @@ -348,7 +392,6 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia | ... | @@ -348,7 +392,6 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia |
348 | outChildList.add( equipmentOutChild ); | 392 | outChildList.add( equipmentOutChild ); |
349 | equipmentOutDTO.setEquipmentOutChildList( outChildList ); | 393 | equipmentOutDTO.setEquipmentOutChildList( outChildList ); |
350 | 394 | ||
351 | |||
352 | // 创建出库单 | 395 | // 创建出库单 |
353 | equipmentOutService.saveEquipmentOut(equipmentOutDTO); | 396 | equipmentOutService.saveEquipmentOut(equipmentOutDTO); |
354 | 397 | ... | ... |
1 | package com.skua.modules.erp.vo; | ||
2 | |||
3 | /** | ||
4 | * @auther kangwei | ||
5 | * @create 2025-03-11-15:33 | ||
6 | */ | ||
7 | |||
8 | import io.swagger.annotations.ApiModel; | ||
9 | import io.swagger.annotations.ApiModelProperty; | ||
10 | import lombok.Data; | ||
11 | |||
12 | |||
13 | /** | ||
14 | * 审批记录表 | ||
15 | */ | ||
16 | @Data | ||
17 | @ApiModel(value="erp_approve_record对象", description="审批对象") | ||
18 | public class ApprovalRecordVO { | ||
19 | |||
20 | @ApiModelProperty(value = "审批对象的主键") | ||
21 | private String id; | ||
22 | |||
23 | /**审批人*/ | ||
24 | @ApiModelProperty(value = "审批意见") | ||
25 | private String approveMessage; | ||
26 | /**审批状态*/ | ||
27 | @ApiModelProperty(value = "审批状态") | ||
28 | private String auditStatus; | ||
29 | } |
... | @@ -25,10 +25,7 @@ public class MaterialINVO extends MaterialIN { | ... | @@ -25,10 +25,7 @@ public class MaterialINVO extends MaterialIN { |
25 | 25 | ||
26 | @ApiModelProperty(value = "权限厂站编号集合") | 26 | @ApiModelProperty(value = "权限厂站编号集合") |
27 | private String departIds; | 27 | private String departIds; |
28 | /**药剂(物料)名称*/ | 28 | |
29 | @Excel(name = "药剂(物料)名称", width = 15) | ||
30 | @ApiModelProperty(value = "药剂(物料)名称") | ||
31 | private String sparepartName; | ||
32 | 29 | ||
33 | @ApiModelProperty(value = "物料编码") | 30 | @ApiModelProperty(value = "物料编码") |
34 | private String sparepartCode; | 31 | private String sparepartCode; | ... | ... |
... | @@ -18,18 +18,26 @@ public interface DangerLevelManageMapper extends BaseMapper<DangerLevelManage> { | ... | @@ -18,18 +18,26 @@ public interface DangerLevelManageMapper extends BaseMapper<DangerLevelManage> { |
18 | * 根据id获取风险分级对象 | 18 | * 根据id获取风险分级对象 |
19 | * @param id | 19 | * @param id |
20 | * @return | 20 | * @return |
21 | * 测试的sql语句 select * from danger_level_manage where id = '4e7200f531db9f6409ecc81d24b07486'; | ||
22 | * select * from danger_inspection_record where danger_id = '4e7200f531db9f6409ecc81d24b07486'; | ||
23 | * select * from danger_inspection_info where inspection_record_id = '1898976888818851842'; | ||
24 | * select * from danger_inspection_item where inspection_info_id in ( '1898976888844017665' ,'1898976888919515137'); | ||
21 | */ | 25 | */ |
22 | public DangerLevelManage queryById(@Param("id") String id); | 26 | public DangerLevelManage queryById(@Param("id") String id); |
23 | 27 | ||
24 | //List<DangerLevelManage> queryByList(Page page, @Param("param") DangerLevelManage dangerLevelManage); | 28 | //List<DangerLevelManage> queryByList(Page page, @Param("param") DangerLevelManage dangerLevelManage); |
25 | @Select("SELECT t.*,ifnull(aaa.inspect_content,'') inspect_content, ifnull(bbb.inspection_num,0) inspection_num, ifnull(ccc.rectification_num,0) 'rectification_num' " + | 29 | @Select("SELECT t.*,ifnull(aaa.inspect_content,'') inspect_content, ifnull(ccc.inspection_num,0) inspection_num, ifnull(bbb.rectification_num,0) 'rectification_num' " + |
26 | " FROM danger_level_manage t" + | 30 | " FROM danger_level_manage t" + |
27 | " left join (select danger_id ,GROUP_CONCAT(inspect_name SEPARATOR '@') 'inspect_content' from danger_inspect_info group by danger_id)aaa on aaa.danger_id = t.id " + | 31 | " left join (select danger_id ,GROUP_CONCAT(inspect_name SEPARATOR '@') 'inspect_content' from danger_inspect_info group by danger_id)aaa on aaa.danger_id = t.id " + |
28 | " left join (select danger_id, count(id) 'inspection_num' from danger_inspection_record " + | 32 | " left join (select eee.danger_id ,count(eee.record_id) 'rectification_num' from ( select DISTINCT t.id 'record_id' ,t1.danger_id from danger_inspection_record t" + |
29 | " where DATE_FORMAT(report_date,'%Y-%m-%d') >= #{startTime} and DATE_FORMAT(report_date,'%Y-%m-%d') <= #{endTime} "+ | 33 | " left join danger_inspection_info t1 on t.id= t1.inspection_record_id left join danger_inspection_item t2 on t1.id = t2.inspection_info_id " + |
30 | " group by danger_id)bbb on bbb.danger_id = t.id " + | 34 | " where t2.status = 0 and DATE_FORMAT(t.report_date,'%Y-%m-%d') >= #{startTime} and DATE_FORMAT(t.report_date,'%Y-%m-%d') <= #{endTime} "+ |
31 | " left join (select danger_id, count(id) 'rectification_num' from ajh_rectification_info" + | 35 | " )eee group by eee.danger_id " + |
36 | " )bbb on bbb.danger_id = t.id " + | ||
37 | " left join (select danger_id, count(id) 'inspection_num' from ajh_rectification_info" + | ||
32 | " where DATE_FORMAT(rec_ord_report_date,'%Y-%m-%d') >= #{startTime} and DATE_FORMAT(rec_ord_report_date,'%Y-%m-%d') <= #{endTime} "+ | 38 | " where DATE_FORMAT(rec_ord_report_date,'%Y-%m-%d') >= #{startTime} and DATE_FORMAT(rec_ord_report_date,'%Y-%m-%d') <= #{endTime} "+ |
33 | " group by danger_id)ccc on ccc.danger_id = t.id ${ew.customSqlSegment}") | 39 | " group by danger_id)ccc on ccc.danger_id = t.id ${ew.customSqlSegment}") |
34 | List<DangerLevelManage> getListByWrapper(Page page,@Param("ew") QueryWrapper<DangerLevelManage> queryWrapper,@Param("startTime") String startTime,@Param("endTime") String endTime); | 40 | List<DangerLevelManage> getListByWrapper(Page page,@Param("ew") QueryWrapper<DangerLevelManage> queryWrapper,@Param("startTime") String startTime,@Param("endTime") String endTime); |
41 | |||
35 | } | 42 | } |
43 | ... | ... |
... | @@ -129,17 +129,30 @@ public class EquipmentInfoMonthReportController { | ... | @@ -129,17 +129,30 @@ public class EquipmentInfoMonthReportController { |
129 | sql = "select round(ifnull(sum(total_cost),0)/10000,2) 'repair_cost' from equipment_repair where reality_maintenance_end_time >= '"+startDate+" 00:00:00' and reality_maintenance_end_time <='"+endDate+" 23:59:59'"; | 129 | sql = "select round(ifnull(sum(total_cost),0)/10000,2) 'repair_cost' from equipment_repair where reality_maintenance_end_time >= '"+startDate+" 00:00:00' and reality_maintenance_end_time <='"+endDate+" 23:59:59'"; |
130 | String repair_cost = commonSqlService.queryForString(sql); | 130 | String repair_cost = commonSqlService.queryForString(sql); |
131 | dataMap.put("repairCost",repair_cost);//执行XX万元 | 131 | dataMap.put("repairCost",repair_cost);//执行XX万元 |
132 | |||
133 | dataMap.put("executionRate","");//执行比例 | ||
134 | |||
135 | |||
132 | //本月计划开展大修技改项目XX项,完成XX项 | 136 | //本月计划开展大修技改项目XX项,完成XX项 |
133 | sql = " select count(1) 'count' from ( select emp.maintenance_type , emt.results_enforcement from equipment_maintain_task emt left join equipment_maintain_plan emp on emt.plan_id = emp.id "; | 137 | sql = " select count(1) 'count' from ( select emp.maintenance_type , emt.results_enforcement from equipment_maintain_task emt left join equipment_maintain_plan emp on emt.plan_id = emp.id "; |
134 | sql += " where emt.maintain_time >= '"+startDate+" 00:00:00' and emt.maintain_time <='"+endDate+" 23:59:59' ) aaa where aaa.maintenance_type = 'dxjg' "; | 138 | sql += " where emt.maintain_time >= '"+startDate+" 00:00:00' and emt.maintain_time <='"+endDate+" 23:59:59' ) aaa where aaa.maintenance_type = 'dxjg' "; |
135 | String dxjg_count = commonSqlService.queryForString(sql); | 139 | String dxjg_count = commonSqlService.queryForString(sql); |
136 | dataMap.put("dxjgCount",dxjg_count);//本月计划开展大修技改项目XX项,完成XX项 | 140 | dataMap.put("dxjgCount",dxjg_count);//本月计划开展大修技改项目XX项,完成XX项 |
141 | |||
142 | sql = " select count(1) 'count' from ( select emp.maintenance_type , emt.results_enforcement from equipment_maintain_task emt left join equipment_maintain_plan emp on emt.plan_id = emp.id "; | ||
143 | sql += " where emt.maintain_time >= '"+startDate+" 00:00:00' and emt.maintain_time <='"+endDate+" 23:59:59' ) aaa where aaa.results_enforcement >2 and aaa.maintenance_type = 'dxjg' "; | ||
144 | String dxjg_complete_count = commonSqlService.queryForString(sql); | ||
145 | dataMap.put("dxjg_complete_count",dxjg_complete_count);//完成XX项 | ||
146 | |||
147 | dataMap.put("dxjg_sy_count",dxjg_complete_count);//剩余 | ||
148 | |||
137 | //生产类设备资产购置XX台 | 149 | //生产类设备资产购置XX台 |
138 | sql = " select count(1) 'count' from (select emp.maintenance_type , emt.results_enforcement from equipment_maintain_task emt left join equipment_maintain_plan emp on emt.plan_id = emp.id "; | 150 | sql = " select count(1) 'count' from (select emp.maintenance_type , emt.results_enforcement from equipment_maintain_task emt left join equipment_maintain_plan emp on emt.plan_id = emp.id "; |
139 | sql += " where emt.maintain_time >= '"+startDate+" 00:00:00' and emt.maintain_time <='"+endDate+" 23:59:59' ) aaa where aaa.results_enforcement >2 and aaa.maintenance_type = 'dxjg'"; | 151 | sql += " where emt.maintain_time >= '"+startDate+" 00:00:00' and emt.maintain_time <='"+endDate+" 23:59:59' ) aaa where aaa.results_enforcement >2 and aaa.maintenance_type = 'dxjg'"; |
140 | String equipment_count = commonSqlService.queryForString(sql); | 152 | String equipment_count = commonSqlService.queryForString(sql); |
141 | dataMap.put("equipmentCount",equipment_count);//生产类设备资产购置XX台 | 153 | dataMap.put("equipmentCount",equipment_count);//生产类设备资产购置XX台 |
142 | 154 | ||
155 | |||
143 | return dataMap; | 156 | return dataMap; |
144 | } | 157 | } |
145 | 158 | ||
... | @@ -147,7 +160,7 @@ public class EquipmentInfoMonthReportController { | ... | @@ -147,7 +160,7 @@ public class EquipmentInfoMonthReportController { |
147 | //水务公司设备管理统计表 | 160 | //水务公司设备管理统计表 |
148 | private List<Map<String,Object>> equipmentStatistics(String departIds,String startDate,String endDate){ | 161 | private List<Map<String,Object>> equipmentStatistics(String departIds,String startDate,String endDate){ |
149 | String sql = "select d.id depart_id , d.depart_name ,round(ifnull(aaa.intact,0),2) 'intact', round(ifnull(bbb.plan_cost,0),2) 'plan_cost', round(ifnull(ccc.repair_cost,0),2) 'repair_cost',"; | 162 | String sql = "select d.id depart_id , d.depart_name ,round(ifnull(aaa.intact,0),2) 'intact', round(ifnull(bbb.plan_cost,0),2) 'plan_cost', round(ifnull(ccc.repair_cost,0),2) 'repair_cost',"; |
150 | sql += " ifnull(ifnull(eee.repair_form_complete_count,0) / ifnull(ddd.repair_form_total_count,9999999999999.99),0) 'repair_form_complete_rate', ifnull(eee.repair_form_complete_count,0) 'repair_form_complete_count', ifnull(ifnull(fff.complete_count,0) / ifnull(ggg.total_count,9999999999999.99),0) 'inspection_complete_rate'"; | 163 | sql += " ifnull(ifnull(100 * eee.repair_form_complete_count,0) / ifnull(ddd.repair_form_total_count,9999999999999.99),0) 'repair_form_complete_rate', ifnull(eee.repair_form_complete_count,0) 'repair_form_complete_count', ifnull(ifnull(fff.complete_count,0)*100 / ifnull(ggg.total_count,9999999999999.99),0) 'inspection_complete_rate'"; |
151 | sql += " from sys_depart d "; | 164 | sql += " from sys_depart d "; |
152 | sql += " left join ( SELECT er.depart_id ,ifnull(( COUNT(id)*30 - IFNULL( SUM( UNIX_TIMESTAMP( reality_maintenance_end_time )- UNIX_TIMESTAMP( repair_date ) )/ 60 / 60 / 24, 0 )) *100/ (COUNT(id)*30) , 0) 'intact' FROM equipment_repair er "; | 165 | sql += " left join ( SELECT er.depart_id ,ifnull(( COUNT(id)*30 - IFNULL( SUM( UNIX_TIMESTAMP( reality_maintenance_end_time )- UNIX_TIMESTAMP( repair_date ) )/ 60 / 60 / 24, 0 )) *100/ (COUNT(id)*30) , 0) 'intact' FROM equipment_repair er "; |
153 | sql += " WHERE er.del_flag = 1 and er.create_time >= '"+startDate+"' and er.create_time <= '"+endDate+"' group by er.depart_id ) aaa on aaa.depart_id = d.id"; | 166 | sql += " WHERE er.del_flag = 1 and er.create_time >= '"+startDate+"' and er.create_time <= '"+endDate+"' group by er.depart_id ) aaa on aaa.depart_id = d.id"; |
... | @@ -166,7 +179,7 @@ public class EquipmentInfoMonthReportController { | ... | @@ -166,7 +179,7 @@ public class EquipmentInfoMonthReportController { |
166 | } | 179 | } |
167 | //设备大修、更新开展情况 | 180 | //设备大修、更新开展情况 |
168 | private List<Map<String,Object>> equipmentMaintainList(String departIds,String startDate,String endDate){ | 181 | private List<Map<String,Object>> equipmentMaintainList(String departIds,String startDate,String endDate){ |
169 | String sql = "select d.id depart_id , d.depart_name , ifnull(aaa.plan_name,'') 'plan_name' , round( ifnull(aaa.plan_cost,0), 2) 'plan_cost', round(ifnull(bbb.maintenance_cost,0),2) 'maintenance_cost' from sys_depart d "; | 182 | String sql = "select d.id depart_id , d.depart_name , ifnull(aaa.plan_name,'') 'plan_name' , round( ifnull(aaa.plan_cost,0), 2) 'plan_cost', round(ifnull(bbb.maintenance_cost,0),2) 'maintenance_cost' ,'' as 'reason' from sys_depart d "; |
170 | sql += " left join (select depart_id, GROUP_CONCAT(plan_name,',') 'plan_name' ,(sum(ifnull(plan_cost,0))/10000) 'plan_cost' from equipment_maintain_plan where maintenance_type = 'dxjg' and release_status='1' and start_time >= '"+startDate+" 00:00:00' and end_time <='"+endDate+" 23:59:59' group by depart_id )aaa on aaa.depart_id = d.id "; | 183 | sql += " left join (select depart_id, GROUP_CONCAT(plan_name,',') 'plan_name' ,(sum(ifnull(plan_cost,0))/10000) 'plan_cost' from equipment_maintain_plan where maintenance_type = 'dxjg' and release_status='1' and start_time >= '"+startDate+" 00:00:00' and end_time <='"+endDate+" 23:59:59' group by depart_id )aaa on aaa.depart_id = d.id "; |
171 | sql += " left join ( select emt.depart_id, sum(ifnull(maintenance_cost,0)) maintenance_cost from equipment_maintain_task emt ,equipment_maintain_plan emp where emt.plan_id = emp.id and emp.maintenance_type = 'dxjg' and emt.maintain_time >= '"+startDate+" 00:00:00' and emt.maintain_time <='"+endDate+" 23:59:59' group by emt.depart_id )bbb on bbb.depart_id = d.id "; | 184 | sql += " left join ( select emt.depart_id, sum(ifnull(maintenance_cost,0)) maintenance_cost from equipment_maintain_task emt ,equipment_maintain_plan emp where emt.plan_id = emp.id and emp.maintenance_type = 'dxjg' and emt.maintain_time >= '"+startDate+" 00:00:00' and emt.maintain_time <='"+endDate+" 23:59:59' group by emt.depart_id )bbb on bbb.depart_id = d.id "; |
172 | sql += " where d.depart_type = 1 "; | 185 | sql += " where d.depart_type = 1 "; |
... | @@ -177,9 +190,9 @@ public class EquipmentInfoMonthReportController { | ... | @@ -177,9 +190,9 @@ public class EquipmentInfoMonthReportController { |
177 | } | 190 | } |
178 | //4、A类重点设备运行情况 | 191 | //4、A类重点设备运行情况 |
179 | private List<Map<String,Object>> equipmentARunList(String departIds,String startDate,String endDate){ | 192 | private List<Map<String,Object>> equipmentARunList(String departIds,String startDate,String endDate){ |
180 | String sql =" select d.id 'depart_id', d.depart_name , aaa.equipment_name, aaa.fault_library_id from sys_depart d"; | 193 | String sql =" select d.id 'depart_id', d.depart_name , aaa.equipment_name, aaa.fault_library_id ,aaa.fault_content from sys_depart d"; |
181 | sql += " left join (select er.id 'info_id', er.depart_id , ei.equipment_name , GROUP_CONCAT(er.fault_content) fault_content , GROUP_CONCAT( er.fault_library_id) fault_library_id from equipment_repair er , equipment_info ei "; | 194 | sql += " left join (select er.id 'info_id', er.depart_id , ei.equipment_name , GROUP_CONCAT(er.fault_content) fault_content , GROUP_CONCAT( er.fault_library_id) fault_library_id from equipment_repair er , equipment_info ei "; |
182 | sql += " where er.info_id = ei.id and and ei.equipment_level = '6bf727eb7e7cca6a95c694dab0036b2c' and repair_date >= '"+startDate+" 00:00:00' and repair_date <='"+endDate+" 23:59:59' "; | 195 | sql += " where er.info_id = ei.id and ei.equipment_level = '6bf727eb7e7cca6a95c694dab0036b2c' and repair_date >= '"+startDate+" 00:00:00' and repair_date <='"+endDate+" 23:59:59' "; |
183 | sql += " group by er.depart_id ,er.info_id )aaa on aaa.depart_id = d.id "; | 196 | sql += " group by er.depart_id ,er.info_id )aaa on aaa.depart_id = d.id "; |
184 | sql += " where d.depart_type = 1 "; | 197 | sql += " where d.depart_type = 1 "; |
185 | if(StringUtils.isNotEmpty(departIds)){ | 198 | if(StringUtils.isNotEmpty(departIds)){ | ... | ... |
-
请 注册 或 登录 后发表评论