diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/CostPushController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/CostPushController.java index 51492bdd..194bd019 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/CostPushController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/CostPushController.java @@ -68,6 +68,21 @@ public class CostPushController extends BaseController { } } + /** + * 查询费用推送审核--列表 + */ + @RequestMapping(value = "getCostPushLeaseList", method = RequestMethod.GET) + public TableDataInfo getCostPushLeaseList(CostPushBean o) { + try { + List results = service.getCostPushLeaseList(o); + return getDataTable(results); + } catch (Exception e) { + logger.error(e.toString(), e); + throw new ServiceException("数据查询异常,请联系运维人员查询日志处理"); + } + } + + /** * 查询消耗费用推送审核--列表 */ diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/CostPushBean.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/CostPushBean.java index cd732a50..e52a64a3 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/CostPushBean.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/CostPushBean.java @@ -105,7 +105,7 @@ public class CostPushBean implements java.io.Serializable { private String body; - private String pushStatus = "1"; + private String pushStatus; private String pushRemark; @@ -114,5 +114,9 @@ public class CostPushBean implements java.io.Serializable { */ @Excel(name = "是否审核", sort = 5, readConverterExp = "0=未审核,1=已审核") private int checkStatus; + + private Integer status; + + private String sltTime; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/mapper/CostPushMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/mapper/CostPushMapper.java index 942e401b..9752de94 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/mapper/CostPushMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/mapper/CostPushMapper.java @@ -57,4 +57,6 @@ public interface CostPushMapper { int updatePushAQStatus(CostPushBean bean); int updatePushXHStatus(CostPushBean bean); + + List getCostPushLeaseList(CostPushBean o); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/CostPushService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/CostPushService.java index 5c60b4f2..2a2fee94 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/CostPushService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/CostPushService.java @@ -55,4 +55,6 @@ public interface CostPushService { * 更新消耗品状态 */ int updatePushXHStatus(CostPushBean bean); + + List getCostPushLeaseList(CostPushBean o); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/CostPushServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/CostPushServiceImpl.java index bd67ff64..891d22ef 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/CostPushServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/CostPushServiceImpl.java @@ -47,6 +47,9 @@ public class CostPushServiceImpl implements CostPushService { // TODO Auto-generated method stub List beanList = dao.getCostPushCheckList(o); calcTotalMoney(beanList); + if(beanList.isEmpty()){ + return null; + } return beanList.get(beanList.size() - 1); } @@ -73,6 +76,17 @@ public class CostPushServiceImpl implements CostPushService { return list.get(list.size() - 1); } + /** + * 获取租赁费用推送审核数据 + */ + @Override + public List getCostPushLeaseList(CostPushBean o) { + + return dao.getCostPushLeaseList(o); + } + + + @Override public List findDetails(CostPushBean o) { List list = dao.findDetails(o); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/RentalCostsServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/RentalCostsServiceImpl.java index 5d309e9a..6cc741cb 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/RentalCostsServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/RentalCostsServiceImpl.java @@ -85,24 +85,23 @@ public class RentalCostsServiceImpl implements RentalCostsService { List total = new ArrayList<>(); for(ConsProjectLeaseMoneyBean bean : list){ String agreementId = bean.getAgreementId(); - String projectId = bean.getProjectId(); - String leaseType = bean.getLeaseType(); - String leaseName = bean.getLeaseName(); + // 机具部分,中转表 project_month_info - float leaseTotal = generatePushData4Machines(leaseName,agreementId,projectId,leaseType, startTime, endTime, taskId); + float leaseTotal = generatePushData4Machines(agreementId, startTime, endTime, taskId); //消耗品部分,中转表 project_month_info - float consTotal = generatePushData4Consumables(leaseName,agreementId,projectId,leaseType, startTime, endTime, taskId); + float consTotal = generatePushData4Consumables(agreementId, startTime, endTime, taskId); //报废费用,中转表 project_month_info - float scrapTotal = generatePushData4Scrap(leaseName,agreementId,projectId,leaseType, startTime, endTime, taskId); + float scrapTotal = generatePushData4Scrap(agreementId, startTime, endTime, taskId); //丢失费用,中转表 project_month_info - float lostTotal = generatePushData4Lost(leaseName,agreementId,projectId,leaseType, startTime, endTime, taskId); + float lostTotal = generatePushData4Lost(agreementId, startTime, endTime, taskId); //维修费用,中转表 project_month_info - float repairTotal = generatePushData4Repair(leaseName,agreementId,projectId,leaseType, startTime, endTime, taskId); + float repairTotal = generatePushData4Repair(agreementId, startTime, endTime, taskId); + if (leaseTotal > 0 || consTotal > 0 || scrapTotal > 0 || lostTotal > 0) { bean.setLeaseTotal(leaseTotal + ""); bean.setConsTotal(consTotal + ""); @@ -120,14 +119,13 @@ public class RentalCostsServiceImpl implements RentalCostsService { } } - private float generatePushData4Machines(String leaseName,String agreementId,String projectId,String leaseType,String startTime, String endTime, String taskId) { + private float generatePushData4Machines(String agreementId,String startTime, String endTime, String taskId) { System.out.println("开始机具费用数据收集定时任务"); AccProjectLeaseMoneyBean o = new AccProjectLeaseMoneyBean(); o.setStartTime(startTime); o.setEndTime(endTime); o.setAgreementId(agreementId); - o.setProjectId(projectId); - o.setLeaseType(leaseType); + BigDecimal total = new BigDecimal("0"); List infos = accDao.getLeaseMoneyDetail(o); @@ -135,9 +133,6 @@ public class RentalCostsServiceImpl implements RentalCostsService { for(AccProjectLeaseMoneyBean info : infos){ info.setTaskId(taskId); info.setAgreementId(agreementId); - info.setLeaseType(leaseType); - info.setProjectId(projectId); - info.setLeaseName(leaseName); total = total.add(new BigDecimal(info.getLeaseMoney())); } @@ -151,14 +146,13 @@ public class RentalCostsServiceImpl implements RentalCostsService { } - private float generatePushData4Consumables(String leaseName,String agreementId,String projectId,String leaseType,String startTime, String endTime, String taskId) { + private float generatePushData4Consumables(String agreementId,String startTime, String endTime, String taskId) { System.out.println("开始消耗品费用数据收集定时任务"); ConsProjectLeaseMoneyBean o = new ConsProjectLeaseMoneyBean(); o.setStartTime(startTime); o.setEndTime(endTime); o.setAgreementId(agreementId); - o.setProjectId(projectId); - o.setLeaseType(leaseType); + BigDecimal total = new BigDecimal("0"); List infos = consDao.getConsMonthMoney(o); @@ -166,9 +160,6 @@ public class RentalCostsServiceImpl implements RentalCostsService { for(ConsProjectLeaseMoneyBean info : infos){ info.setTaskId(taskId); info.setAgreementId(agreementId); - info.setLeaseType(leaseType); - info.setProjectId(projectId); - info.setLeaseName(leaseName); total = total.add(new BigDecimal(info.getLeaseMoney())); } @@ -180,14 +171,13 @@ public class RentalCostsServiceImpl implements RentalCostsService { return total.setScale(2).floatValue(); } - private float generatePushData4Scrap(String leaseName,String agreementId,String projectId,String leaseType,String startTime, String endTime, String taskId) { + private float generatePushData4Scrap(String agreementId,String startTime, String endTime, String taskId) { System.out.println("开始报废费用数据收集定时任务"); ConsProjectLeaseMoneyBean o = new ConsProjectLeaseMoneyBean(); o.setStartTime(startTime); o.setEndTime(endTime); o.setAgreementId(agreementId); - o.setProjectId(projectId); - o.setLeaseType(leaseType); + BigDecimal total = new BigDecimal("0"); List infos = consDao.getScrapMoney(o); @@ -195,9 +185,6 @@ public class RentalCostsServiceImpl implements RentalCostsService { for(ConsProjectLeaseMoneyBean info : infos){ info.setTaskId(taskId); info.setAgreementId(agreementId); - info.setLeaseType(leaseType); - info.setProjectId(projectId); - info.setLeaseName(leaseName); info.setType("4"); total = total.add(new BigDecimal(info.getLeaseMoney())); } @@ -209,14 +196,13 @@ public class RentalCostsServiceImpl implements RentalCostsService { return total.setScale(2).floatValue(); } - private float generatePushData4Lost(String leaseName,String agreementId,String projectId,String leaseType,String startTime, String endTime, String taskId) { + private float generatePushData4Lost(String agreementId,String startTime, String endTime, String taskId) { System.out.println("开始丢失费用数据收集定时任务"); ConsProjectLeaseMoneyBean o = new ConsProjectLeaseMoneyBean(); o.setStartTime(startTime); o.setEndTime(endTime); o.setAgreementId(agreementId); - o.setProjectId(projectId); - o.setLeaseType(leaseType); + BigDecimal total = new BigDecimal("0"); List infos = consDao.getLostMoney(o); @@ -224,10 +210,7 @@ public class RentalCostsServiceImpl implements RentalCostsService { for(ConsProjectLeaseMoneyBean info : infos){ info.setTaskId(taskId); info.setAgreementId(agreementId); - info.setLeaseType(leaseType); - info.setProjectId(projectId); - info.setLeaseName(leaseName); - info.setType("2"); + info.setType("5"); total = total.add(new BigDecimal(info.getLeaseMoney())); } int res = consDao.insertProjectOthersMonthInfo(infos); @@ -238,14 +221,13 @@ public class RentalCostsServiceImpl implements RentalCostsService { return total.setScale(2).floatValue(); } - private float generatePushData4Repair(String leaseName, String agreementId, String projectId, String leaseType, String startTime, String endTime, String taskId) { + private float generatePushData4Repair(String agreementId,String startTime, String endTime, String taskId) { System.out.println("开始维修费用数据收集定时任务"); ConsProjectLeaseMoneyBean o = new ConsProjectLeaseMoneyBean(); o.setStartTime(startTime); o.setEndTime(endTime); o.setAgreementId(agreementId); - o.setProjectId(projectId); - o.setLeaseType(leaseType); + BigDecimal total = new BigDecimal("0"); List infos = consDao.getRepairMoney(o); @@ -253,9 +235,6 @@ public class RentalCostsServiceImpl implements RentalCostsService { for(ConsProjectLeaseMoneyBean info : infos){ info.setTaskId(taskId); info.setAgreementId(agreementId); - info.setLeaseType(leaseType); - info.setProjectId(projectId); - info.setLeaseName(leaseName); info.setType("3"); total = total.add(new BigDecimal(info.getLeaseMoney())); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/controller/SysWorkflowNodeController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/controller/SysWorkflowNodeController.java index b0ad5138..f6d5e2d8 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/controller/SysWorkflowNodeController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/work/controller/SysWorkflowNodeController.java @@ -29,13 +29,13 @@ public class SysWorkflowNodeController extends BaseController { @GetMapping("/list") public TableDataInfo list(SysWorkflowNode sysWorkflowNode) { - try { +// try { startPage(); List list = sysWorkflowNodeService.selectSysWorkflowNodeList(sysWorkflowNode); return getDataTable(list); - }catch (Exception e){ - return getDataTableError(null); - } +// }catch (Exception e){ +// return getDataTableError(null); +// } } /** diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/push/AccProjectLeaseMoneylMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/push/AccProjectLeaseMoneylMapper.xml index 7d7fb23e..ea4f9dd1 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/push/AccProjectLeaseMoneylMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/push/AccProjectLeaseMoneylMapper.xml @@ -13,7 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" res.id, res.deviceName, res.deviceModel, - res.modelId, + res.typeId, sum(res.leaseNum) as leaseNum, res.startTime, IF(DATEDIFF(res.endTime, res.sltTime) > 0,res.sltTime,res.endTime) as endTime , @@ -26,9 +26,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT sai.id, - sai.type_id as modelId, - mt2.name as deviceName, - mt1.name as deviceModel, + sai.type_id as typeId, + mt2.type_name as deviceName, + mt1.type_name as deviceModel, sai.num AS leaseNum, IF(DATEDIFF(sai.start_time,#{startTime}) > 0,sai.start_time,#{startTime}) as startTime, IF(DATEDIFF( #{endTime} ,ifnull(tt.CREATE_TIME,#{endTime})) > 0,tt.CREATE_TIME,#{endTime}) as endTime, @@ -39,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" slt_agreement_info sai LEFT JOIN ma_type mt1 ON sai.type_id = mt1.type_id LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id - LEFT JOIN tm_task tt on sai..back_id = tt.task_id + LEFT JOIN tm_task tt on sai.back_id = tt.task_id WHERE sai.agreement_id = #{agreementId} AND mt1.CONSUMABLE != 1 @@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) res - group by res.modelId, + group by res.typeId, res.startTime, res.endTime HAVING leaseDay > 0 @@ -55,15 +55,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" insert into project_month_info (agreementId,typeId,leaseNum,leaseDate,returnDate,leasePrice,leaseMoney, - taskId,push_status,push_time,push_remark,is_flag,type,buy_price,money) + taskId,push_status,push_time,push_remark,is_flag,type,jiju_type,buy_price,money) VALUES ( #{item.leaseName}, #{item.typeId}, #{item.leaseNum}, - #{item.leaseDate}, - #{item.returnDate}, + #{item.startTime}, + #{item.endTime}, #{item.leasePrice}, #{item.leaseMoney}, #{item.taskId}, @@ -72,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{item.pushRemark}, 0, 1, + 1, #{item.buyPrice}, #{item.money} ) diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/push/ConsProjectLeaseMoneyMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/push/ConsProjectLeaseMoneyMapper.xml index ace27e3c..988f7dbd 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/push/ConsProjectLeaseMoneyMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/push/ConsProjectLeaseMoneyMapper.xml @@ -20,10 +20,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" res.id, res.deviceName, res.deviceModel, - res.modelId, + res.typeId, sum(res.leaseNum) as leaseNum, res.startTime, - res.buyPrice, + res.buyPrice as leasePrice, res.code, sum(ROUND(res.leaseNum*res.buyPrice*res.type,2)) as leaseMoney, res.time @@ -31,9 +31,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ( SELECT sai.id, - sai.type_id as modelId, - mt2.name as deviceName, - mt1.name as deviceModel, + sai.type_id as typeId, + mt2.type_name as deviceName, + mt1.type_name as deviceModel, sai.num AS leaseNum, sai.start_time as startTime, tt.CODE as code, @@ -44,16 +44,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" slt_agreement_info sai LEFT JOIN ma_type mt1 ON sai.type_id = mt1.type_id LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id - LEFT JOIN tm_task tt on sai..back_id = tt.task_id + LEFT JOIN tm_task tt on sai.back_id = tt.task_id WHERE sai.agreement_id = #{agreementId} AND sai.start_time BETWEEN #{startTime} AND #{endTime} AND mt1.CONSUMABLE = 1 AND (ISNULL(sai.end_time) OR LEFT(sai.start_time,7) != LEFT(sai.end_time,7)) UNION SELECT sai.ID, - sai.type_id as modelId, - mt2.name as deviceName, - mt1.name as deviceModel, + sai.type_id as typeId, + mt2.type_name as deviceName, + mt1.type_name as deviceModel, sai.NUM AS leaseNum, sai.start_time as startTime, tt.CODE as code, @@ -63,28 +63,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" slt_agreement_info sai LEFT JOIN ma_type mt1 ON sai.type_id = mt1.type_id LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id - LEFT JOIN tm_task tt on sai..back_id = tt.task_id + LEFT JOIN tm_task tt on sai.back_id = tt.task_id WHERE sai.agreement_id = #{agreementId} AND sai.status = 1 AND sai.end_time BETWEEN #{startTime} AND #{endTime} AND mt1.CONSUMABLE = 1 AND LEFT(sai.start_time,7) != LEFT(sai.end_time,7) AND sai.start_time > '2024-01-01' ) res - group by res.modelId, + group by res.typeId, res.startTime, res.code insert into project_month_info (agreementId,typeId,leaseNum,leaseDate,returnDate,leasePrice,leaseMoney, - taskId,push_status,push_time,push_remark,is_flag,type,buy_price,money) + taskId,push_status,push_time,push_remark,is_flag,type,jiju_type,buy_price,money) VALUES ( #{item.leaseName}, #{item.typeId}, #{item.leaseNum}, - #{item.leaseDate}, + #{item.startTime}, #{item.returnDate}, #{item.leasePrice}, #{item.leaseMoney}, @@ -94,6 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{item.pushRemark}, 0, 2, + 1, #{item.buyPrice}, #{item.money} ) @@ -120,15 +121,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" insert into project_month_info (agreementId,typeId,leaseNum,leaseDate,returnDate,leasePrice,leaseMoney, - taskId,push_status,push_time,push_remark,is_flag,type,buy_price,money) + taskId,push_status,push_time,push_remark,is_flag,type,jiju_type,buy_price,money) VALUES ( #{item.leaseName}, #{item.typeId}, #{item.leaseNum}, - #{item.leaseDate}, - #{item.returnDate}, + #{item.startTime}, + #{item.endTime}, #{item.leasePrice}, #{item.leaseMoney}, #{item.taskId}, @@ -137,6 +138,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{item.pushRemark}, 0, #{item.type}, + 1, #{item.buyPrice}, #{item.money} ) @@ -181,7 +183,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" insert into project_month_costs (agreement_id,lease_money,cons_money,scrap_money, - lost_money,repair_money,task_id,is_flag,month) + lost_money,repair_money,task_id,is_flag,month,jiju_type) VALUES ( @@ -193,7 +195,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{item.repairTotal}, #{item.taskId}, 0, - #{item.month} + #{item.month}, + 1 ) diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/push/MybatisGenerator.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/push/MybatisGenerator.xml index 3967a523..1916b107 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/push/MybatisGenerator.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/push/MybatisGenerator.xml @@ -49,6 +49,18 @@ bp.pro_id is not null and (pmc.LEASE_MONEY > 0 or pmc.LOST_MONEY > 0 or pmc.REPAIR_MONEY > 0 or pmc.SCRAP_MONEY > 0) + + AND pmia.push_status = #{status} + + + AND cpm.month = #{month} + + + AND bma.project_id = #{projectId} + + + AND bma.unit_id = #{unitId} + GROUP BY bai.project_id,bai.unit_id order by pmia.push_status @@ -218,4 +230,31 @@ and mmq.`type_name` LIKE CONCAT('%',#{modelName},'%') + \ No newline at end of file