diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java
index 0b1f9e29..b9643f11 100644
--- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java
+++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java
@@ -159,7 +159,8 @@ public class RepairServiceImpl implements RepairService {
partDetails.setPartCost("0");
}
BigDecimal partCost = new BigDecimal(partDetails.getPartCost());
- sfCosts = sfCosts.add(partCost);
+ BigDecimal partNumber = new BigDecimal(partDetails.getPartNum());
+ sfCosts = sfCosts.add(partCost.multiply(partNumber));
} else if (bsfPart.equals(partDetails.getPartType())) {
if (StringUtils.isEmpty(partDetails.getPartCost())) {
partDetails.setPartCost("0");
diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/RepairMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/RepairMapper.xml
index 80017de6..966c20c4 100644
--- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/RepairMapper.xml
+++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/RepairMapper.xml
@@ -22,8 +22,8 @@
values (#{taskId},#{id},#{maId},#{typeId},#{repairNum},#{repairedNum},#{scrapNum},'0',#{createBy},now(),#{companyId});
- insert into repair_cost (task_id,repair_id,type_id,ma_id,repair_num,costs,part_type,status,company_id)
- values (#{bean.taskId},#{bean.id},#{bean.typeId},#{bean.maId},#{bean.repairNum},#{costs},#{partType},'0',#{bean.companyId});
+ insert into repair_cost (task_id,repair_id,type_id,ma_id,repair_num,costs,part_type,status,company_id,repair_type)
+ values (#{bean.taskId},#{bean.id},#{bean.typeId},#{bean.maId},#{bean.repairNum},#{costs},#{partType},'0',#{bean.companyId},#{bean.repairType});
update repair_apply_details
diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java
index 5e923164..3f7ba614 100644
--- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java
+++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java
@@ -35,7 +35,7 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
private SltAgreementInfoMapper sltAgreementInfoMapper;
@Override
- public List getSltAgreementInfo(AgreementInfo bean) {
+ public List getSltAgreementInfo(AgreementInfo bean) {
return sltAgreementInfoMapper.getSltAgreementInfo(bean);
}
@@ -54,7 +54,7 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
sltInfoVo.setRepairList(repairList);
sltInfoVo.setScrapList(scrapList);
sltInfoVo.setLoseList(loseList);
- List relations = getRelations(leaseList,repairList,scrapList,loseList,list);
+ List relations = getRelations(leaseList, repairList, scrapList, loseList, list);
sltInfoVo.setRelations(relations);
return sltInfoVo;
}
@@ -66,7 +66,7 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
String cost = sltAgreementInfoMapper.getCost(apply);
List relations = sltAgreementInfoMapper.getRelations(apply);
sltInfoVo.setRelations(relations);
- for (SltAgreementRelation relation : relations){
+ for (SltAgreementRelation relation : relations) {
AgreementInfo info = new AgreementInfo();
info.setAgreementId(Long.valueOf(relation.getAgreementId()));
list.add(info);
@@ -90,23 +90,23 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
apply.setAuditor(String.valueOf(userid));
int i = sltAgreementInfoMapper.updateRelation(apply);
int j = 0;
- if (i > 0){
+ if (i > 0) {
List relations = sltAgreementInfoMapper.getRelations(apply);
List infos = new ArrayList<>();
- for (SltAgreementRelation bean : relations){
+ for (SltAgreementRelation bean : relations) {
AgreementInfo info = new AgreementInfo();
info.setAgreementId(Long.valueOf(bean.getAgreementId()));
infos.add(info);
}
List loseList = getLoseList(infos);
- for (SltAgreementInfo agreementInfo : loseList){
- if (agreementInfo.getMaId() != null && agreementInfo.getMaId().isEmpty()){
+ for (SltAgreementInfo agreementInfo : loseList) {
+ if (agreementInfo.getMaId() != null && agreementInfo.getMaId().isEmpty()) {
agreementInfo.setStatus("103");
sltAgreementInfoMapper.updateMaStatus(agreementInfo);
}
}
j = sltAgreementInfoMapper.updateApply(apply);
- }else {
+ } else {
throw new ServiceException("结算审核失败");
//throw new ServiceException(ExceptionDict.SETTLEMENT_REVIEW_ERROR_MSG,ExceptionDict.SETTLEMENT_REVIEW_ERROR);
}
@@ -115,14 +115,14 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
private List getRelations(List leaseList, List repairList, List scrapList, List loseList, List list) {
List relations = new ArrayList<>();
- for (AgreementInfo info : list){
+ for (AgreementInfo info : list) {
SltAgreementRelation relation = new SltAgreementRelation();
BigDecimal loseCost = BigDecimal.ZERO;
BigDecimal leaseCost = BigDecimal.ZERO;
BigDecimal scrapCost = BigDecimal.ZERO;
BigDecimal repairCost = BigDecimal.ZERO;
- for (SltAgreementInfo lease : leaseList){
- if (lease.getAgreementId().equals(info.getAgreementId().toString())){
+ for (SltAgreementInfo lease : leaseList) {
+ if (lease.getAgreementId().equals(info.getAgreementId().toString())) {
relation.setAgreementId(lease.getAgreementId());
relation.setProjectName(lease.getProjectName());
relation.setUnitName(lease.getUnitName());
@@ -131,20 +131,20 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
leaseCost = leaseCost.add(cost);
}
}
- for (SltAgreementInfo repair : repairList){
- if (repair.getAgreementId().equals(info.getAgreementId().toString())){
+ for (SltAgreementInfo repair : repairList) {
+ if (repair.getAgreementId().equals(info.getAgreementId().toString())) {
BigDecimal cost = new BigDecimal(repair.getCosts());
repairCost = repairCost.add(cost);
}
}
- for (SltAgreementInfo scrap : scrapList){
- if (scrap.getAgreementId().equals(info.getAgreementId().toString())){
+ for (SltAgreementInfo scrap : scrapList) {
+ if (scrap.getAgreementId().equals(info.getAgreementId().toString())) {
BigDecimal cost = new BigDecimal(scrap.getCosts());
scrapCost = scrapCost.add(cost);
}
}
- for (SltAgreementInfo lose : loseList){
- if (lose.getAgreementId().equals(info.getAgreementId().toString())){
+ for (SltAgreementInfo lose : loseList) {
+ if (lose.getAgreementId().equals(info.getAgreementId().toString())) {
//TODO 上面已经set过值,这里为什么还要set值
relation.setAgreementId(lose.getAgreementId());
relation.setProjectName(lose.getProjectName());
@@ -174,15 +174,15 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
apply.setCode(code);
apply.setCompanyId(relations.get(0).getCompanyId());
int i = sltAgreementInfoMapper.insApply(apply);
- if (i > 0){
- for (SltAgreementRelation relation : relations){
+ if (i > 0) {
+ for (SltAgreementRelation relation : relations) {
AgreementInfo info = new AgreementInfo();
info.setAgreementId(Long.valueOf(relation.getAgreementId()));
list.add(info);
relation.setApplyId(String.valueOf(apply.getId()));
sltAgreementInfoMapper.updateInfoStatus(relation.getAgreementId());
int j = sltAgreementInfoMapper.insRelation(relation);
- if (j < 0){
+ if (j < 0) {
throw new ServiceException("新增协议结算记录失败");
//throw new ServiceException(ExceptionDict.NEW_AGREEMENT_SETTLEMENT_ERROR_MSG,ExceptionDict.NEW_AGREEMENT_SETTLEMENT_ERROR);
}
@@ -191,7 +191,7 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
List repairList = getRepairList(list);
List scrapList = getScrapList(list);
List loseList = getLoseList(list);
- for (SltAgreementInfo info : leaseList){
+ for (SltAgreementInfo info : leaseList) {
info.setSltType("1");
//info.setSltType(CostTypeEnum.LEASE_COST.getCode());
info.setApplyId(String.valueOf(apply.getId()));
@@ -199,34 +199,34 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
//info.setPartType(PartTypeEnum.CHARGE.getCode());
sltAgreementInfoMapper.insDetails(info);
}
- for (SltAgreementInfo info : repairList){
+ for (SltAgreementInfo info : repairList) {
info.setSltType("3");
//info.setSltType(CostTypeEnum.MAINTENANCE_COST.getCode());
info.setApplyId(String.valueOf(apply.getId()));
//对是否收费进行转换
//info.setPartType(PartTypeEnum.getCodeByInfo(info.getPartType()));
- info.setPartType(info.getPartType()=="不收费" ? "0" : "1");
+ info.setPartType(info.getPartType() == "不收费" ? "0" : "1");
sltAgreementInfoMapper.insDetails(info);
}
- for (SltAgreementInfo info : scrapList){
+ for (SltAgreementInfo info : scrapList) {
info.setSltType("4");
//info.setSltType(CostTypeEnum.SCRAP_COST.getCode());
info.setApplyId(String.valueOf(apply.getId()));
//info.setPartType(info.getScrapType());
//info.setPartType(ScrapTypeEnum.getCodeByInfo(info.getScrapType()));
- info.setPartType(info.getScrapType()=="自然" ? "0" : "1");
+ info.setPartType(info.getScrapType() == "自然" ? "0" : "1");
sltAgreementInfoMapper.insDetails(info);
}
- for (SltAgreementInfo info : loseList){
+ for (SltAgreementInfo info : loseList) {
info.setSltType("2");
//info.setSltType(CostTypeEnum.LOSE_COST.getCode());
info.setApplyId(String.valueOf(apply.getId()));
- info.setPartType("1");
+ info.setPartType("1");
//info.setPartType(PartTypeEnum.CHARGE.getCode());
sltAgreementInfoMapper.insDetails(info);
}
- }else {
+ } else {
throw new ServiceException("新增结算单号失败");
//throw new ServiceException(ExceptionDict.NEW_SETTLEMENT_NUMBER_ERROR_MSG,ExceptionDict.NEW_SETTLEMENT_NUMBER_ERROR);
}
@@ -241,15 +241,15 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
public List getLoseList(List list) {
List loseList = new ArrayList<>();
- for (AgreementInfo bean : list){
+ for (AgreementInfo bean : list) {
List oneOfList = sltAgreementInfoMapper.getLoseList(bean);
loseList.addAll(oneOfList);
}
- for (SltAgreementInfo bean : loseList){
- if (bean.getBuyPrice() == null){
+ for (SltAgreementInfo bean : loseList) {
+ if (bean.getBuyPrice() == null) {
bean.setBuyPrice("0");
}
- if (bean.getNum() == null){
+ if (bean.getNum() == null) {
bean.setNum("0");
}
BigDecimal buyPrice = new BigDecimal(bean.getBuyPrice());
@@ -272,20 +272,20 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
List scrapList = new ArrayList<>();
String taskType = "57";
//String taskType = TaskTypeEnum.SCRAP_TASK.getCode();
- for (AgreementInfo bean : list){
- List taskList = sltAgreementInfoMapper.getTaskList(bean,taskType);
- if (taskList != null && taskList.size() > 0){
+ for (AgreementInfo bean : list) {
+ List taskList = sltAgreementInfoMapper.getTaskList(bean, taskType);
+ if (taskList != null && taskList.size() > 0) {
List scrapDetailsList = sltAgreementInfoMapper.getScrapDetailsList(taskList);
scrapList.addAll(scrapDetailsList);
}
}
- if (scrapList != null && scrapList.size() > 0){
- for (SltAgreementInfo bean : scrapList){
+ if (scrapList != null && scrapList.size() > 0) {
+ for (SltAgreementInfo bean : scrapList) {
- if (bean.getBuyPrice() == null){
+ if (bean.getBuyPrice() == null) {
bean.setBuyPrice("0");
}
- if (bean.getNum() == null){
+ if (bean.getNum() == null) {
bean.setNum("0");
}
BigDecimal buyPrice = new BigDecimal(bean.getBuyPrice());
@@ -309,9 +309,9 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
List repairList = new ArrayList<>();
String taskType = "41";
//String taskType = TaskTypeEnum.MAINTENANCE_TASK.getCode();
- for (AgreementInfo bean : list){
- List taskList = sltAgreementInfoMapper.getTaskList(bean,taskType);
- if (taskList != null && taskList.size() > 0){
+ for (AgreementInfo bean : list) {
+ List taskList = sltAgreementInfoMapper.getTaskList(bean, taskType);
+ if (taskList != null && taskList.size() > 0) {
List repairDetailsList = sltAgreementInfoMapper.getRepairDetailsList(taskList);
repairList.addAll(repairDetailsList);
}
@@ -321,18 +321,18 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
public List getLeaseList(List list) {
List leaseList = new ArrayList<>();
- for (AgreementInfo bean : list){
+ for (AgreementInfo bean : list) {
List oneOfList = sltAgreementInfoMapper.getLeaseList(bean);
leaseList.addAll(oneOfList);
}
- for (SltAgreementInfo bean : leaseList){
- if (bean.getLeasePrice() == null){
+ for (SltAgreementInfo bean : leaseList) {
+ if (bean.getLeasePrice() == null) {
bean.setLeasePrice("0");
}
- if (bean.getNum() == null){
+ if (bean.getNum() == null) {
bean.setNum("0");
}
- if (bean.getLeaseDays() == null){
+ if (bean.getLeaseDays() == null) {
bean.setLeaseDays("0");
}
BigDecimal leasePrice = new BigDecimal(bean.getLeasePrice());
@@ -344,7 +344,9 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
return leaseList;
}
- /**结算单号编码生成规则*/
+ /**
+ * 结算单号编码生成规则
+ */
private String sltCodeRule(String code) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
Date nowDate = DateUtils.getNowDate();
diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml
index 5e807611..af65b641 100644
--- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml
+++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml
@@ -92,14 +92,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and type_id = #{typeId}