bug修复
This commit is contained in:
parent
033f4ba75f
commit
ecb952183c
|
|
@ -20,6 +20,7 @@ import io.swagger.annotations.ApiOperation;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -31,8 +32,8 @@ import java.util.List;
|
|||
@RestController
|
||||
@RequestMapping("/sltAgreementInfo")
|
||||
public class SltAgreementInfoController extends BaseController {
|
||||
@Autowired
|
||||
private SltAgreementInfoService service;
|
||||
@Resource
|
||||
private SltAgreementInfoService sltAgreementInfoService;
|
||||
|
||||
/**
|
||||
* 根据条件获取协议结算列表
|
||||
|
|
@ -42,11 +43,16 @@ public class SltAgreementInfoController extends BaseController {
|
|||
public TableDataInfo getSltAgreementInfo(AgreementInfo bean) {
|
||||
startPage();
|
||||
List<AgreementInfo> list = new ArrayList<>();
|
||||
//逻辑需要确认,当往来单位id,工程标段ID,结算状态为空时是否返回异常,如果返回异常前端配合改造
|
||||
if (bean.getUnitId() == null && bean.getProjectId() == null && bean.getSltStatus()== null){
|
||||
|
||||
}else {
|
||||
list = service.getSltAgreementInfo(bean);
|
||||
list = sltAgreementInfoService.getSltAgreementInfo(bean);
|
||||
}
|
||||
//上面代码可以改造为
|
||||
/*if(bean.getUnitId() != null || bean.getProjectId() != null || bean.getSltStatus()!= null){
|
||||
list = sltAgreementInfoService.getSltAgreementInfo(bean);
|
||||
}*/
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
@ -56,7 +62,7 @@ public class SltAgreementInfoController extends BaseController {
|
|||
@ApiOperation(value = "根据协议获取结算清单")
|
||||
@PostMapping("/getSltInfo")
|
||||
public AjaxResult getSltInfo(@RequestBody List<AgreementInfo> list) {
|
||||
SltInfoVo bean = service.getSltInfo(list);
|
||||
SltInfoVo bean = sltAgreementInfoService.getSltInfo(list);
|
||||
return AjaxResult.success(bean);
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +73,7 @@ public class SltAgreementInfoController extends BaseController {
|
|||
@PostMapping("/exportLease")
|
||||
public void exportLease(HttpServletResponse response,@RequestBody List<AgreementInfo> list)
|
||||
{
|
||||
List<SltAgreementInfo> explist = service.getLeaseList(list);
|
||||
List<SltAgreementInfo> explist = sltAgreementInfoService.getLeaseList(list);
|
||||
List<LeaseInfo> leaseInfoList = Convert.toList(LeaseInfo.class,explist);
|
||||
ExcelUtil<LeaseInfo> util = new ExcelUtil<LeaseInfo>(LeaseInfo.class);
|
||||
util.exportExcel(response, leaseInfoList, "租赁明细导出");
|
||||
|
|
@ -80,7 +86,7 @@ public class SltAgreementInfoController extends BaseController {
|
|||
@PostMapping("/exportLose")
|
||||
public void exportLose(HttpServletResponse response,@RequestBody List<AgreementInfo> list)
|
||||
{
|
||||
List<SltAgreementInfo> explist = service.getLoseList(list);
|
||||
List<SltAgreementInfo> explist = sltAgreementInfoService.getLoseList(list);
|
||||
List<LoseInfo> leaseInfoList = Convert.toList(LoseInfo.class,explist);
|
||||
ExcelUtil<LoseInfo> util = new ExcelUtil<LoseInfo>(LoseInfo.class);
|
||||
util.exportExcel(response, leaseInfoList, "丢失明细导出");
|
||||
|
|
@ -93,7 +99,7 @@ public class SltAgreementInfoController extends BaseController {
|
|||
@PostMapping("/exportRepair")
|
||||
public void exportRepair(HttpServletResponse response,@RequestBody List<AgreementInfo> list)
|
||||
{
|
||||
List<SltAgreementInfo> explist = service.getRepairList(list);
|
||||
List<SltAgreementInfo> explist = sltAgreementInfoService.getRepairList(list);
|
||||
List<LeaseInfo> leaseInfoList = Convert.toList(LeaseInfo.class,explist);
|
||||
ExcelUtil<LeaseInfo> util = new ExcelUtil<LeaseInfo>(LeaseInfo.class);
|
||||
util.exportExcel(response, leaseInfoList, "维修明细导出");
|
||||
|
|
@ -106,7 +112,7 @@ public class SltAgreementInfoController extends BaseController {
|
|||
@PostMapping("/exportScrap")
|
||||
public void exportScrap(HttpServletResponse response,@RequestBody List<AgreementInfo> list)
|
||||
{
|
||||
List<SltAgreementInfo> explist = service.getScrapList(list);
|
||||
List<SltAgreementInfo> explist = sltAgreementInfoService.getScrapList(list);
|
||||
List<ScrapInfo> leaseInfoList = Convert.toList(ScrapInfo.class,explist);
|
||||
ExcelUtil<ScrapInfo> util = new ExcelUtil<ScrapInfo>(ScrapInfo.class);
|
||||
util.exportExcel(response, leaseInfoList, "维修明细导出");
|
||||
|
|
@ -119,7 +125,7 @@ public class SltAgreementInfoController extends BaseController {
|
|||
@PostMapping("/submitFee")
|
||||
public AjaxResult submitFee(@RequestBody SltAgreementApply apply)
|
||||
{
|
||||
return service.submitFee(apply);
|
||||
return sltAgreementInfoService.submitFee(apply);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -130,7 +136,7 @@ public class SltAgreementInfoController extends BaseController {
|
|||
public TableDataInfo getSltExam(AgreementInfo bean)
|
||||
{
|
||||
startPage();
|
||||
List<SltAgreementApply> list = service.getSltExam(bean);
|
||||
List<SltAgreementApply> list = sltAgreementInfoService.getSltExam(bean);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
@ -141,7 +147,7 @@ public class SltAgreementInfoController extends BaseController {
|
|||
@GetMapping("/getSltExamInfo")
|
||||
public AjaxResult getSltExamInfo(SltAgreementApply apply)
|
||||
{
|
||||
SltInfoVo bean = service.getSltExamInfo(apply);
|
||||
SltInfoVo bean = sltAgreementInfoService.getSltExamInfo(apply);
|
||||
return AjaxResult.success(bean);
|
||||
}
|
||||
|
||||
|
|
@ -152,7 +158,7 @@ public class SltAgreementInfoController extends BaseController {
|
|||
@GetMapping("/settlementReview")
|
||||
public AjaxResult settlementReview(SltAgreementApply apply)
|
||||
{
|
||||
return toAjax(service.settlementReview(apply));
|
||||
return toAjax(sltAgreementInfoService.settlementReview(apply));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,21 +4,24 @@ import com.bonus.sgzb.base.api.domain.SltAgreementApply;
|
|||
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
|
||||
import com.bonus.sgzb.base.api.domain.SltAgreementRelation;
|
||||
import com.bonus.sgzb.base.api.domain.SltInfoVo;
|
||||
import com.bonus.sgzb.common.core.enums.CostTypeEnum;
|
||||
import com.bonus.sgzb.common.core.enums.PartTypeEnum;
|
||||
import com.bonus.sgzb.common.core.enums.ScrapTypeEnum;
|
||||
import com.bonus.sgzb.common.core.enums.TaskTypeEnum;
|
||||
import com.bonus.sgzb.common.core.exception.ServiceException;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.material.domain.AgreementInfo;
|
||||
import com.bonus.sgzb.material.domain.RepairTaskDetails;
|
||||
import com.bonus.sgzb.material.domain.ScrapApplyDetails;
|
||||
import com.bonus.sgzb.material.domain.TmTask;
|
||||
import com.bonus.sgzb.material.exception.ExceptionDict;
|
||||
import com.bonus.sgzb.material.mapper.SltAgreementInfoMapper;
|
||||
import com.bonus.sgzb.material.service.SltAgreementInfoService;
|
||||
import com.bonus.sgzb.material.vo.GlobalContants;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -31,20 +34,24 @@ import java.util.List;
|
|||
*/
|
||||
@Service
|
||||
public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
|
||||
@Autowired
|
||||
private SltAgreementInfoMapper mapper;
|
||||
@Resource
|
||||
private SltAgreementInfoMapper sltAgreementInfoMapper;
|
||||
|
||||
@Override
|
||||
public List<AgreementInfo> getSltAgreementInfo(AgreementInfo bean) {
|
||||
return mapper.getSltAgreementInfo(bean);
|
||||
public List<AgreementInfo> getSltAgreementInfo(AgreementInfo bean) {
|
||||
return sltAgreementInfoMapper.getSltAgreementInfo(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SltInfoVo getSltInfo(List<AgreementInfo> list) {
|
||||
SltInfoVo sltInfoVo = new SltInfoVo();
|
||||
//租赁费用列表
|
||||
List<SltAgreementInfo> leaseList = getLeaseList(list);
|
||||
//维修费用列表
|
||||
List<SltAgreementInfo> repairList = getRepairList(list);
|
||||
//报废费用列表
|
||||
List<SltAgreementInfo> scrapList = getScrapList(list);
|
||||
//丢失费用列表
|
||||
List<SltAgreementInfo> loseList = getLoseList(list);
|
||||
sltInfoVo.setLeaseList(leaseList);
|
||||
sltInfoVo.setRepairList(repairList);
|
||||
|
|
@ -59,8 +66,8 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
|
|||
public SltInfoVo getSltExamInfo(SltAgreementApply apply) {
|
||||
SltInfoVo sltInfoVo = new SltInfoVo();
|
||||
List<AgreementInfo> list = new ArrayList<>();
|
||||
String cost = mapper.getCost(apply);
|
||||
List<SltAgreementRelation> relations = mapper.getRelations(apply);
|
||||
String cost = sltAgreementInfoMapper.getCost(apply);
|
||||
List<SltAgreementRelation> relations = sltAgreementInfoMapper.getRelations(apply);
|
||||
sltInfoVo.setRelations(relations);
|
||||
for (SltAgreementRelation relation : relations){
|
||||
AgreementInfo info = new AgreementInfo();
|
||||
|
|
@ -84,10 +91,10 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
|
|||
public int settlementReview(SltAgreementApply apply) {
|
||||
Long userid = SecurityUtils.getLoginUser().getUserid();
|
||||
apply.setAuditor(String.valueOf(userid));
|
||||
int i = mapper.updateRelation(apply);
|
||||
int i = sltAgreementInfoMapper.updateRelation(apply);
|
||||
int j = 0;
|
||||
if (i > 0){
|
||||
List<SltAgreementRelation> relations = mapper.getRelations(apply);
|
||||
List<SltAgreementRelation> relations = sltAgreementInfoMapper.getRelations(apply);
|
||||
List<AgreementInfo> infos = new ArrayList<>();
|
||||
for (SltAgreementRelation bean : relations){
|
||||
AgreementInfo info = new AgreementInfo();
|
||||
|
|
@ -97,12 +104,13 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
|
|||
List<SltAgreementInfo> loseList = getLoseList(infos);
|
||||
for (SltAgreementInfo agreementInfo : loseList){
|
||||
if (agreementInfo.getMaId() != null && agreementInfo.getMaId().isEmpty()){
|
||||
mapper.updateMaStatus(agreementInfo);
|
||||
sltAgreementInfoMapper.updateMaStatus(agreementInfo);
|
||||
}
|
||||
}
|
||||
j = mapper.updateApply(apply);
|
||||
j = sltAgreementInfoMapper.updateApply(apply);
|
||||
}else {
|
||||
throw new ServiceException("结算审核失败");
|
||||
//throw new ServiceException(ExceptionDict.SETTLEMENT_REVIEW_ERROR_MSG,ExceptionDict.SETTLEMENT_REVIEW_ERROR);
|
||||
}
|
||||
return j;
|
||||
}
|
||||
|
|
@ -111,10 +119,14 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
|
|||
List<SltAgreementRelation> relations = new ArrayList<>();
|
||||
for (AgreementInfo info : list){
|
||||
SltAgreementRelation relation = new SltAgreementRelation();
|
||||
BigDecimal loseCost = new BigDecimal("0");
|
||||
/*BigDecimal loseCost = new BigDecimal("0");
|
||||
BigDecimal leaseCost = new BigDecimal("0");
|
||||
BigDecimal scrapCost = new BigDecimal("0");
|
||||
BigDecimal repairCost = new BigDecimal("0");
|
||||
BigDecimal repairCost = new BigDecimal("0");*/
|
||||
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())){
|
||||
relation.setAgreementId(lease.getAgreementId());
|
||||
|
|
@ -139,6 +151,7 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
|
|||
}
|
||||
for (SltAgreementInfo lose : loseList){
|
||||
if (lose.getAgreementId().equals(info.getAgreementId().toString())){
|
||||
//TODO 上面已经set过值,这里为什么还要set值
|
||||
relation.setAgreementId(lose.getAgreementId());
|
||||
relation.setProjectName(lose.getProjectName());
|
||||
relation.setUnitName(lose.getUnitName());
|
||||
|
|
@ -166,17 +179,18 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
|
|||
apply.setCreator(String.valueOf(userid));
|
||||
apply.setCode(code);
|
||||
apply.setCompanyId(relations.get(0).getCompanyId());
|
||||
int i = mapper.insApply(apply);
|
||||
int i = sltAgreementInfoMapper.insApply(apply);
|
||||
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()));
|
||||
mapper.updateInfoStatus(relation.getAgreementId());
|
||||
int j = mapper.insRelation(relation);
|
||||
sltAgreementInfoMapper.updateInfoStatus(relation.getAgreementId());
|
||||
int j = sltAgreementInfoMapper.insRelation(relation);
|
||||
if (j < 0){
|
||||
throw new ServiceException("新增协议结算记录失败");
|
||||
//throw new ServiceException(ExceptionDict.NEW_AGREEMENT_SETTLEMENT_ERROR_MSG,ExceptionDict.NEW_AGREEMENT_SETTLEMENT_ERROR);
|
||||
}
|
||||
}
|
||||
List<SltAgreementInfo> leaseList = getLeaseList(list);
|
||||
|
|
@ -185,45 +199,57 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
|
|||
List<SltAgreementInfo> loseList = getLoseList(list);
|
||||
for (SltAgreementInfo info : leaseList){
|
||||
info.setSltType("1");
|
||||
//info.setSltType(CostTypeEnum.LEASE_COST.getCode());
|
||||
info.setApplyId(String.valueOf(apply.getId()));
|
||||
info.setPartType("1");
|
||||
mapper.insDetails(info);
|
||||
//info.setPartType(PartTypeEnum.CHARGE.getCode());
|
||||
sltAgreementInfoMapper.insDetails(info);
|
||||
}
|
||||
for (SltAgreementInfo info : repairList){
|
||||
info.setSltType("3");
|
||||
//info.setSltType(CostTypeEnum.MAINTENANCE_COST.getCode());
|
||||
info.setApplyId(String.valueOf(apply.getId()));
|
||||
mapper.insDetails(info);
|
||||
//对是否收费进行转换
|
||||
//info.setPartType(PartTypeEnum.getCodeByInfo(info.getPartType()));
|
||||
info.setPartType(info.getPartType()=="不收费" ? "0" : "1");
|
||||
sltAgreementInfoMapper.insDetails(info);
|
||||
}
|
||||
for (SltAgreementInfo info : scrapList){
|
||||
info.setSltType("4");
|
||||
//info.setSltType(CostTypeEnum.SCRAP_COST.getCode());
|
||||
info.setApplyId(String.valueOf(apply.getId()));
|
||||
info.setPartType(info.getScrapType());
|
||||
mapper.insDetails(info);
|
||||
//info.setPartType(info.getScrapType());
|
||||
//info.setPartType(ScrapTypeEnum.getCodeByInfo(info.getScrapType()));
|
||||
info.setPartType(info.getScrapType()=="自然" ? "0" : "1");
|
||||
sltAgreementInfoMapper.insDetails(info);
|
||||
}
|
||||
for (SltAgreementInfo info : loseList){
|
||||
info.setSltType("2");
|
||||
//info.setSltType(CostTypeEnum.LOSE_COST.getCode());
|
||||
info.setApplyId(String.valueOf(apply.getId()));
|
||||
info.setPartType("1");
|
||||
mapper.insDetails(info);
|
||||
info.setPartType("1");
|
||||
//info.setPartType(PartTypeEnum.CHARGE.getCode());
|
||||
sltAgreementInfoMapper.insDetails(info);
|
||||
}
|
||||
|
||||
}else {
|
||||
throw new ServiceException("新增结算单号失败");
|
||||
//throw new ServiceException(ExceptionDict.NEW_SETTLEMENT_NUMBER_ERROR_MSG,ExceptionDict.NEW_SETTLEMENT_NUMBER_ERROR);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SltAgreementApply> getSltExam(AgreementInfo bean) {
|
||||
return mapper.getSltExam(bean);
|
||||
return sltAgreementInfoMapper.getSltExam(bean);
|
||||
}
|
||||
|
||||
|
||||
public List<SltAgreementInfo> getLoseList(List<AgreementInfo> list) {
|
||||
List<SltAgreementInfo> loseList = new ArrayList<>();
|
||||
for (AgreementInfo bean : list){
|
||||
List<SltAgreementInfo> oneOflist = mapper.getLoseList(bean);
|
||||
loseList.addAll(oneOflist);
|
||||
List<SltAgreementInfo> oneOfList = sltAgreementInfoMapper.getLoseList(bean);
|
||||
loseList.addAll(oneOfList);
|
||||
}
|
||||
for (SltAgreementInfo bean : loseList){
|
||||
if (bean.getBuyPrice() == null){
|
||||
|
|
@ -235,7 +261,14 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
|
|||
BigDecimal buyPrice = new BigDecimal(bean.getBuyPrice());
|
||||
BigDecimal num = new BigDecimal(bean.getNum());
|
||||
BigDecimal costs = buyPrice.multiply(num);
|
||||
bean.setCosts(String.valueOf(costs));
|
||||
//计算租赁费用
|
||||
/* BigDecimal costs = BigDecimal.ZERO;
|
||||
if (bean.getBuyPrice() != null && bean.getNum() != null){
|
||||
BigDecimal buyPrice = new BigDecimal(bean.getBuyPrice());
|
||||
BigDecimal num = new BigDecimal(bean.getNum());
|
||||
costs = buyPrice.multiply(num);
|
||||
}
|
||||
bean.setCosts(String.valueOf(costs));*/
|
||||
}
|
||||
return loseList;
|
||||
}
|
||||
|
|
@ -243,15 +276,17 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
|
|||
public List<SltAgreementInfo> getScrapList(List<AgreementInfo> list) {
|
||||
List<SltAgreementInfo> scrapList = new ArrayList<>();
|
||||
String taskType = "57";
|
||||
//String taskType = TaskTypeEnum.SCRAP_TASK.getCode();
|
||||
for (AgreementInfo bean : list){
|
||||
List<TmTask> taskList = mapper.getTaskList(bean,taskType);
|
||||
List<TmTask> taskList = sltAgreementInfoMapper.getTaskList(bean,taskType);
|
||||
if (taskList != null && taskList.size() > 0){
|
||||
List<SltAgreementInfo> scrapDetailsList = mapper.getScrapDetailsList(taskList);
|
||||
List<SltAgreementInfo> scrapDetailsList = sltAgreementInfoMapper.getScrapDetailsList(taskList);
|
||||
scrapList.addAll(scrapDetailsList);
|
||||
}
|
||||
}
|
||||
if (scrapList != null && scrapList.size() > 0){
|
||||
for (SltAgreementInfo bean : scrapList){
|
||||
|
||||
if (bean.getBuyPrice() == null){
|
||||
bean.setBuyPrice("0");
|
||||
}
|
||||
|
|
@ -261,6 +296,13 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
|
|||
BigDecimal buyPrice = new BigDecimal(bean.getBuyPrice());
|
||||
BigDecimal num = new BigDecimal(bean.getNum());
|
||||
BigDecimal costs = buyPrice.multiply(num);
|
||||
//计算总金额
|
||||
/*BigDecimal costs = BigDecimal.ZERO;
|
||||
if (bean.getBuyPrice() != null && bean.getBuyPrice() != null){
|
||||
BigDecimal buyPrice = new BigDecimal(bean.getBuyPrice());
|
||||
BigDecimal num = new BigDecimal(bean.getNum());
|
||||
costs = buyPrice.multiply(num);
|
||||
}*/
|
||||
bean.setCosts(String.valueOf(costs));
|
||||
}
|
||||
}
|
||||
|
|
@ -271,10 +313,11 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
|
|||
public List<SltAgreementInfo> getRepairList(List<AgreementInfo> list) {
|
||||
List<SltAgreementInfo> repairList = new ArrayList<>();
|
||||
String taskType = "41";
|
||||
//String taskType = TaskTypeEnum.MAINTENANCE_TASK.getCode();
|
||||
for (AgreementInfo bean : list){
|
||||
List<TmTask> taskList = mapper.getTaskList(bean,taskType);
|
||||
List<TmTask> taskList = sltAgreementInfoMapper.getTaskList(bean,taskType);
|
||||
if (taskList != null && taskList.size() > 0){
|
||||
List<SltAgreementInfo> repairDetailsList = mapper.getRepairDetailsList(taskList);
|
||||
List<SltAgreementInfo> repairDetailsList = sltAgreementInfoMapper.getRepairDetailsList(taskList);
|
||||
repairList.addAll(repairDetailsList);
|
||||
}
|
||||
}
|
||||
|
|
@ -284,8 +327,8 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
|
|||
public List<SltAgreementInfo> getLeaseList(List<AgreementInfo> list) {
|
||||
List<SltAgreementInfo> leaseList = new ArrayList<>();
|
||||
for (AgreementInfo bean : list){
|
||||
List<SltAgreementInfo> oneOflist = mapper.getLeaseList(bean);
|
||||
leaseList.addAll(oneOflist);
|
||||
List<SltAgreementInfo> oneOfList = sltAgreementInfoMapper.getLeaseList(bean);
|
||||
leaseList.addAll(oneOfList);
|
||||
}
|
||||
for (SltAgreementInfo bean : leaseList){
|
||||
if (bean.getLeasePrice() == null){
|
||||
|
|
@ -302,6 +345,15 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
|
|||
BigDecimal leaseDays = new BigDecimal(bean.getLeaseDays());
|
||||
BigDecimal costs = leasePrice.multiply(num).multiply(leaseDays);
|
||||
bean.setCosts(String.valueOf(costs));
|
||||
/* BigDecimal costs = BigDecimal.ZERO;
|
||||
//当单价,数量,租赁天数都不为空时计算总价
|
||||
if(bean.getLeasePrice() != null && bean.getNum() != null && bean.getLeaseDays() != null){
|
||||
BigDecimal leasePrice = new BigDecimal(bean.getLeasePrice());
|
||||
BigDecimal num = new BigDecimal(bean.getNum());
|
||||
BigDecimal leaseDays = new BigDecimal(bean.getLeaseDays());
|
||||
costs = leasePrice.multiply(num).multiply(leaseDays);
|
||||
}
|
||||
bean.setCosts(String.valueOf(costs));*/
|
||||
}
|
||||
return leaseList;
|
||||
}
|
||||
|
|
@ -311,7 +363,9 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
|
|||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
String format = dateFormat.format(nowDate);
|
||||
int taskNum = mapper.selectNumByDate(nowDate) + 1;
|
||||
//String format = DateUtils.dateTime();
|
||||
//为什么要加1?是为了防止结果为0?
|
||||
int taskNum = sltAgreementInfoMapper.selectNumByDate(nowDate) + 1;
|
||||
String codeNum = "";
|
||||
if (taskNum > GlobalContants.NUM1 && taskNum < GlobalContants.NUM2) {
|
||||
codeNum = code + format + "-00" + taskNum;
|
||||
|
|
|
|||
Loading…
Reference in New Issue