Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
0f29e252bc
|
|
@ -16,10 +16,7 @@ import com.bonus.material.archives.service.ArchivesService;
|
||||||
import com.bonus.material.back.domain.BackApplyDetails;
|
import com.bonus.material.back.domain.BackApplyDetails;
|
||||||
import com.bonus.material.back.domain.HandlingOrder;
|
import com.bonus.material.back.domain.HandlingOrder;
|
||||||
import com.bonus.material.back.domain.MaCode;
|
import com.bonus.material.back.domain.MaCode;
|
||||||
import com.bonus.material.back.domain.vo.BackAppRequestVo;
|
import com.bonus.material.back.domain.vo.*;
|
||||||
import com.bonus.material.back.domain.vo.BackApplyInfoVo;
|
|
||||||
import com.bonus.material.back.domain.vo.BackApplyRequestVo;
|
|
||||||
import com.bonus.material.back.domain.vo.BackApplyVo;
|
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
import com.bonus.system.api.RemoteFileService;
|
import com.bonus.system.api.RemoteFileService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
|
@ -207,6 +204,20 @@ public class BackApplyInfoController extends BaseController {
|
||||||
return backApplyInfoService.selectMachineById(dto);
|
return backApplyInfoService.selectMachineById(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据typeId查询领料机具列表
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "根据typeId查询领料机具列表")
|
||||||
|
@GetMapping("/selectMachineByIdList")
|
||||||
|
public AjaxResult selectMachineByIdList(BackApplyInfo dto){
|
||||||
|
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
||||||
|
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
||||||
|
List<MaCodeVo> list = backApplyInfoService.selectMachineByIdList(dto);
|
||||||
|
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* app根据设备编码去检索领料详情
|
* app根据设备编码去检索领料详情
|
||||||
* @param dto
|
* @param dto
|
||||||
|
|
|
||||||
|
|
@ -129,4 +129,5 @@ public class BackApplyDetails extends BaseEntity {
|
||||||
@ApiModelProperty(value = "一级类型id")
|
@ApiModelProperty(value = "一级类型id")
|
||||||
private Long firstId;
|
private Long firstId;
|
||||||
|
|
||||||
|
List<MaCodeDto> maVos;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ public class HandlingOrder implements Serializable {
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
@ApiModelProperty(value = "排序")
|
@ApiModelProperty(value = "排序")
|
||||||
private Integer sort;
|
private String sort;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建人
|
* 创建人
|
||||||
|
|
@ -79,4 +79,6 @@ public class HandlingOrder implements Serializable {
|
||||||
|
|
||||||
private String endTime;
|
private String endTime;
|
||||||
|
|
||||||
|
private String signUrl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,7 @@ import com.bonus.material.back.domain.BackApplyDetails;
|
||||||
import com.bonus.material.back.domain.BackApplyInfo;
|
import com.bonus.material.back.domain.BackApplyInfo;
|
||||||
import com.bonus.material.back.domain.HandlingOrder;
|
import com.bonus.material.back.domain.HandlingOrder;
|
||||||
import com.bonus.material.back.domain.MaCode;
|
import com.bonus.material.back.domain.MaCode;
|
||||||
import com.bonus.material.back.domain.vo.BackAppRequestVo;
|
import com.bonus.material.back.domain.vo.*;
|
||||||
import com.bonus.material.back.domain.vo.BackApplyInfoVo;
|
|
||||||
import com.bonus.material.back.domain.vo.BackApplyRequestVo;
|
|
||||||
import com.bonus.material.back.domain.vo.BackApplyVo;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退料任务Service接口
|
* 退料任务Service接口
|
||||||
|
|
@ -160,6 +157,8 @@ public interface IBackApplyInfoService {
|
||||||
*/
|
*/
|
||||||
AjaxResult selectMachineById(BackApplyInfo dto);
|
AjaxResult selectMachineById(BackApplyInfo dto);
|
||||||
|
|
||||||
|
List<MaCodeVo> selectMachineByIdList(BackApplyInfo dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APP删除退料任务
|
* APP删除退料任务
|
||||||
* @param id
|
* @param id
|
||||||
|
|
|
||||||
|
|
@ -1200,7 +1200,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
BackApplyDetails details = dto.getBackApplyDetails();
|
BackApplyDetails details = dto.getBackApplyDetails();
|
||||||
details.setCode(dto.getBackApplyInfo().getCode());
|
details.setCode(dto.getBackApplyInfo().getCode());
|
||||||
details.setParentId(dto.getBackApplyInfo().getId());
|
details.setParentId(dto.getBackApplyInfo().getId());
|
||||||
details.setPreNum(BigDecimal.valueOf(1));
|
details.setPreNum(BigDecimal.valueOf(dto.getBackApplyDetails().getMaVos().size()));
|
||||||
details.setAuditNum(details.getPreNum());
|
details.setAuditNum(details.getPreNum());
|
||||||
details.setNum(BigDecimal.valueOf(num));
|
details.setNum(BigDecimal.valueOf(num));
|
||||||
details.setGoodNum(details.getGoodNum());
|
details.setGoodNum(details.getGoodNum());
|
||||||
|
|
@ -1221,25 +1221,42 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
setCommonFields(details, dto.getBackApplyInfo().getId());
|
setCommonFields(details, dto.getBackApplyInfo().getId());
|
||||||
// 插入 CheckDetails
|
// 插入 CheckDetails
|
||||||
//根据id查询back_check_details表,看数据是否存在,存在则对数量进行更新,不存在则插入
|
//根据id查询back_check_details表,看数据是否存在,存在则对数量进行更新,不存在则插入
|
||||||
BackApplyDetails checkDetails = backApplyInfoMapper.selectCheckDetails(details);
|
for(MaCodeDto maCodeDto : details.getMaVos()){
|
||||||
if (checkDetails != null) {
|
BackApplyDetails backInfo = new BackApplyDetails();
|
||||||
checkDetails.setId(checkDetails.getId());
|
backInfo = details;
|
||||||
result += backApplyInfoMapper.updateCheck(checkDetails);
|
backInfo.setMaId(maCodeDto.getMaId());
|
||||||
} else {
|
backInfo.setMaCode(maCodeDto.getMaCode());
|
||||||
result += backApplyInfoMapper.insertCheckDetails(details);
|
BackApplyDetails checkDetails = backApplyInfoMapper.selectCheckDetails(details);
|
||||||
|
if (checkDetails != null) {
|
||||||
|
checkDetails.setId(checkDetails.getId());
|
||||||
|
result += backApplyInfoMapper.updateCheck(checkDetails);
|
||||||
|
} else {
|
||||||
|
result += backApplyInfoMapper.insertCheckDetails(details);
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isNotEmpty(details.getBmFileInfos())) {
|
||||||
|
for (BmFileInfo bmFileInfo : details.getBmFileInfos()) {
|
||||||
|
bmFileInfo.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||||
|
bmFileInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
|
bmFileInfo.setTaskId(details.getId());
|
||||||
|
bmFileInfo.setTaskType(3);
|
||||||
|
bmFileInfo.setModelId(backInfo.getMaId());
|
||||||
|
result += bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//更新ma_machine表状态为3(退料检修)
|
//更新ma_machine表状态为3(退料检修)
|
||||||
// result += machineMapper.updateStatus(details.getMaId(), MaMachineStatusEnum.BACK_REPAIR.getStatus());
|
// result += machineMapper.updateStatus(details.getMaId(), MaMachineStatusEnum.BACK_REPAIR.getStatus());
|
||||||
if (CollectionUtils.isNotEmpty(details.getBmFileInfos())) {
|
// if (CollectionUtils.isNotEmpty(details.getBmFileInfos())) {
|
||||||
for (BmFileInfo bmFileInfo : details.getBmFileInfos()) {
|
// for (BmFileInfo bmFileInfo : details.getBmFileInfos()) {
|
||||||
bmFileInfo.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
// bmFileInfo.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||||
bmFileInfo.setCreateTime(DateUtils.getNowDate());
|
// bmFileInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
bmFileInfo.setTaskId(details.getId());
|
// bmFileInfo.setTaskId(details.getId());
|
||||||
bmFileInfo.setTaskType(3);
|
// bmFileInfo.setTaskType(3);
|
||||||
bmFileInfo.setModelId(details.getMaId());
|
// bmFileInfo.setModelId(details.getMaId());
|
||||||
result += bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
|
// result += bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1354,10 +1371,18 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
}
|
}
|
||||||
//判断输入或者编码识别或者二维码识别是否为领料工程和单位对应
|
//判断输入或者编码识别或者二维码识别是否为领料工程和单位对应
|
||||||
List<MaCodeVo> list = new ArrayList<>();
|
List<MaCodeVo> list = new ArrayList<>();
|
||||||
|
dto.setUserId(SecurityUtils.getLoginUser().getUserid());
|
||||||
if (dto.getMaCode() != null) {
|
if (dto.getMaCode() != null) {
|
||||||
list = backApplyInfoMapper.getMachine(dto);
|
list = backApplyInfoMapper.getMachine(dto);
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
return AjaxResult.error("该编码非您负责的设备,请重新选择");
|
||||||
|
}
|
||||||
} else if (dto.getQrCode() != null) {
|
} else if (dto.getQrCode() != null) {
|
||||||
|
|
||||||
list = backApplyInfoMapper.getMachineByQrCode(dto);
|
list = backApplyInfoMapper.getMachineByQrCode(dto);
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
return AjaxResult.error("该编码非您负责的设备,请重新选择");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isNotEmpty(list)) {
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
for (MaCodeVo maCodeVo : list) {
|
for (MaCodeVo maCodeVo : list) {
|
||||||
|
|
@ -1632,6 +1657,24 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MaCodeVo> selectMachineByIdList(BackApplyInfo dto) {
|
||||||
|
List<MaCodeVo> list = backApplyInfoMapper.getMachineById(dto);
|
||||||
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
// 根据id查询该单据可能存在的设备编码
|
||||||
|
List<MaCodeVo> maCodeVos = backApplyInfoMapper.selectByCode(dto.getId());
|
||||||
|
if (CollectionUtils.isNotEmpty(maCodeVos)) {
|
||||||
|
// 获取maCodeVos中的编码
|
||||||
|
List<String> maCodes = maCodeVos.stream().map(MaCodeVo::getMaCode).collect(Collectors.toList());
|
||||||
|
// 将maCodes中存在于list集合中的编码,把数据从list集合中去除
|
||||||
|
list = list.stream().
|
||||||
|
filter(info -> !maCodes.contains(info.getMaCode())).
|
||||||
|
collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APP删除退料任务
|
* APP删除退料任务
|
||||||
* @param id
|
* @param id
|
||||||
|
|
@ -1681,7 +1724,15 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<HandlingOrder> getHandlingOrderList(HandlingOrder bean) {
|
public List<HandlingOrder> getHandlingOrderList(HandlingOrder bean) {
|
||||||
return backApplyInfoMapper.getHandlingOrderList(bean);
|
List<HandlingOrder> list = backApplyInfoMapper.getHandlingOrderList(bean);
|
||||||
|
if (list.size()>0){
|
||||||
|
for (HandlingOrder handlingOrder : list){
|
||||||
|
if (StringUtils.isNotBlank(handlingOrder.getSignUrl())) {
|
||||||
|
handlingOrder.setSignUrl("data:image/png;base64," + handlingOrder.getSignUrl());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -1693,6 +1744,8 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
if (re > 0) {
|
if (re > 0) {
|
||||||
return AjaxResult.error("今日该号已存在");
|
return AjaxResult.error("今日该号已存在");
|
||||||
}
|
}
|
||||||
|
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||||
|
bean.setUpdateBy(userId.toString());
|
||||||
int res = backApplyInfoMapper.uploadSort(bean);
|
int res = backApplyInfoMapper.uploadSort(bean);
|
||||||
if (res > 0) {
|
if (res > 0) {
|
||||||
return AjaxResult.success("排号成功");
|
return AjaxResult.success("排号成功");
|
||||||
|
|
@ -1798,23 +1851,23 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
HandlingOrder beans = new HandlingOrder();
|
HandlingOrder beans = new HandlingOrder();
|
||||||
String timeTypes = "";
|
String timeTypes = "";
|
||||||
try {
|
try {
|
||||||
//判断现在是上午还是下午,上午为A,下午为B
|
// //判断现在是上午还是下午,上午为A,下午为B
|
||||||
Calendar calendar = Calendar.getInstance();
|
// Calendar calendar = Calendar.getInstance();
|
||||||
int hour = calendar.get(Calendar.HOUR_OF_DAY);
|
// int hour = calendar.get(Calendar.HOUR_OF_DAY);
|
||||||
String timeType = (hour < 12) ? "A" : "B";
|
// String timeType = (hour < 12) ? "A" : "B";
|
||||||
timeTypes = timeType;
|
// timeTypes = timeType;
|
||||||
bean.setTimeType(timeType);
|
// bean.setTimeType(timeType);
|
||||||
bean.setReserveDate(DateUtils.getDate());
|
// bean.setReserveDate(DateUtils.getDate());
|
||||||
//查询当前的排号
|
// //查询当前的排号
|
||||||
HandlingOrder bean1 = backApplyInfoMapper.getSort(bean);
|
// HandlingOrder bean1 = backApplyInfoMapper.getSort(bean);
|
||||||
if (bean1 != null && bean1.getSort() != null) {
|
// if (bean1 != null && bean1.getSort() != null) {
|
||||||
Integer sort = bean1.getSort() + 1;
|
// Integer sort = bean1.getSort() + 1;
|
||||||
beans.setSort(sort);
|
// beans.setSort(sort);
|
||||||
beans.setTimeType(timeType);
|
// beans.setTimeType(timeType);
|
||||||
} else {
|
// } else {
|
||||||
beans.setTimeType(timeType);
|
// beans.setTimeType(timeType);
|
||||||
beans.setSort(1);
|
// beans.setSort(1);
|
||||||
}
|
// }
|
||||||
return AjaxResult.success(beans);
|
return AjaxResult.success(beans);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("获取排号失败", e);
|
log.error("获取排号失败", e);
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ public class ClzSltAgreementInfoController extends BaseController {
|
||||||
|
|
||||||
@ApiOperation(value = "往来单位id和标段工程id获取协议信息")
|
@ApiOperation(value = "往来单位id和标段工程id获取协议信息")
|
||||||
@PostMapping("getAgreementInfoById")
|
@PostMapping("getAgreementInfoById")
|
||||||
public AjaxResult getAgreementInfoById(@RequestBody SelectDto dto){
|
public AjaxResult getAgreementInfoById(@RequestBody SelectDto dto) {
|
||||||
return clzSltAgreementInfoService.getAgreementInfoById(dto);
|
return clzSltAgreementInfoService.getAgreementInfoById(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,7 +79,7 @@ public class ClzSltAgreementInfoController extends BaseController {
|
||||||
dataList.add(vo);
|
dataList.add(vo);
|
||||||
agreementId = info.getAgreementId();
|
agreementId = info.getAgreementId();
|
||||||
}
|
}
|
||||||
bean = mergerData(bean, dataList,unitNames,projectNames);
|
bean = clzSltAgreementInfoService.mergerData(bean, dataList,unitNames,projectNames);
|
||||||
// 根据协议id获取申请时间
|
// 根据协议id获取申请时间
|
||||||
TmTask tmTask = taskMapper.selectTaskByIdByCl(agreementId);
|
TmTask tmTask = taskMapper.selectTaskByIdByCl(agreementId);
|
||||||
if (tmTask != null) {
|
if (tmTask != null) {
|
||||||
|
|
@ -88,60 +88,6 @@ public class ClzSltAgreementInfoController extends BaseController {
|
||||||
return AjaxResult.success(bean);
|
return AjaxResult.success(bean);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MaterialSltInfoVo mergerData(MaterialSltInfoVo vo,List<MaterialSltInfoVo> list,List<String> unitNames,List<String> projectNames){
|
|
||||||
vo.setUnitName(handleData(unitNames));
|
|
||||||
vo.setProjectName(handleData(projectNames));
|
|
||||||
BigDecimal leaseCost = BigDecimal.valueOf(0.00);
|
|
||||||
BigDecimal repairCost = BigDecimal.valueOf(0.00);
|
|
||||||
BigDecimal scrapCost = BigDecimal.valueOf(0.00);
|
|
||||||
BigDecimal loseCost = BigDecimal.valueOf(0.00);
|
|
||||||
BigDecimal reducCost = BigDecimal.valueOf(0.00);
|
|
||||||
//租赁费用列表
|
|
||||||
List<MaterialSltAgreementInfo> leaseList = new ArrayList<>();
|
|
||||||
//维修费用列表
|
|
||||||
List<MaterialSltAgreementInfo> repairList = new ArrayList<>();
|
|
||||||
//报废费用列表
|
|
||||||
List<MaterialSltAgreementInfo> scrapList = new ArrayList<>();
|
|
||||||
//丢失费用列表
|
|
||||||
List<MaterialSltAgreementInfo> loseList = new ArrayList<>();
|
|
||||||
//减免费用列表
|
|
||||||
List<SltAgreementReduce> reductionList = new ArrayList<>();
|
|
||||||
List<SltAgreementRelation> relations = new ArrayList<>();
|
|
||||||
for (MaterialSltInfoVo infoVo : list) {
|
|
||||||
leaseCost = leaseCost.add(infoVo.getLeaseCost());
|
|
||||||
repairCost = repairCost.add(infoVo.getRepairCost());
|
|
||||||
scrapCost = scrapCost.add(infoVo.getScrapCost());
|
|
||||||
loseCost = loseCost.add(infoVo.getLoseCost());
|
|
||||||
reducCost = reducCost.add(infoVo.getReductionCost());
|
|
||||||
leaseList.addAll(infoVo.getLeaseList());
|
|
||||||
repairList.addAll(infoVo.getRepairList());
|
|
||||||
scrapList.addAll(infoVo.getScrapList());
|
|
||||||
loseList.addAll(infoVo.getLoseList());
|
|
||||||
reductionList.addAll(infoVo.getReductionList());
|
|
||||||
relations.addAll(infoVo.getRelations());
|
|
||||||
}
|
|
||||||
vo.setLeaseList(leaseList);
|
|
||||||
vo.setRepairList(repairList);
|
|
||||||
vo.setScrapList(scrapList);
|
|
||||||
vo.setLoseList(loseList);
|
|
||||||
vo.setReductionList(reductionList);
|
|
||||||
vo.setLeaseCost(leaseCost);
|
|
||||||
vo.setRepairCost(repairCost);
|
|
||||||
vo.setScrapCost(scrapCost);
|
|
||||||
vo.setLoseCost(loseCost);
|
|
||||||
vo.setReductionCost(reducCost);
|
|
||||||
vo.setRelations(relations);
|
|
||||||
return vo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String handleData(List<String> list){
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
Set<String> set = new HashSet<>(list);
|
|
||||||
for (String str : set) {
|
|
||||||
sb.append(str).append("、");
|
|
||||||
}
|
|
||||||
return StringUtils.removeEnd(sb.toString(), "、");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交结算清单
|
* 提交结算清单
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,10 @@ public interface ClzSltAgreementInfoService {
|
||||||
*/
|
*/
|
||||||
MaterialSltInfoVo getSltInfo(MaterialSltAgreementInfo info);
|
MaterialSltInfoVo getSltInfo(MaterialSltAgreementInfo info);
|
||||||
|
|
||||||
|
MaterialSltInfoVo mergerData(MaterialSltInfoVo vo, List<MaterialSltInfoVo> list, List<String> unitNames, List<String> projectNames);
|
||||||
|
|
||||||
|
String handleData(List<String> list);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工程下拉框
|
* 工程下拉框
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import com.bonus.material.common.domain.vo.AgreementVo;
|
||||||
import com.bonus.material.settlement.domain.SltAgreementReduce;
|
import com.bonus.material.settlement.domain.SltAgreementReduce;
|
||||||
import com.bonus.material.settlement.domain.SltAgreementRelation;
|
import com.bonus.material.settlement.domain.SltAgreementRelation;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
@ -36,8 +37,7 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件获取协议结算列表
|
* 根据条件获取协议结算列表
|
||||||
* @param bean
|
* @param bean 查询条件
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<MaterialSltAgreementInfo> getSltAgreementInfo4Project(MaterialSltAgreementInfo bean) {
|
public List<MaterialSltAgreementInfo> getSltAgreementInfo4Project(MaterialSltAgreementInfo bean) {
|
||||||
|
|
@ -79,16 +79,6 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
||||||
leaseCost = leaseCost.add(lease.getCosts());
|
leaseCost = leaseCost.add(lease.getCosts());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*for (MaterialSltAgreementInfo repair : repairList) {
|
|
||||||
if(repair.getCosts()!=null && (repair.getPartType().equals("收费"))){
|
|
||||||
repairCost = repairCost.add(repair.getCosts());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (MaterialSltAgreementInfo scrap : scrapList) {
|
|
||||||
if(scrap.getCosts()!=null && (scrap.getPartType().equals("收费"))){
|
|
||||||
scrapCost = scrapCost.add(scrap.getCosts());
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
for (MaterialSltAgreementInfo lose : loseList) {
|
for (MaterialSltAgreementInfo lose : loseList) {
|
||||||
if(lose.getCosts()!=null){
|
if(lose.getCosts()!=null){
|
||||||
loseCost = loseCost.add(lose.getCosts());
|
loseCost = loseCost.add(lose.getCosts());
|
||||||
|
|
@ -109,6 +99,63 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
||||||
return sltInfoVo;
|
return sltInfoVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MaterialSltInfoVo mergerData(MaterialSltInfoVo vo, List<MaterialSltInfoVo> list, List<String> unitNames, List<String> projectNames) {
|
||||||
|
vo.setUnitName(handleData(unitNames));
|
||||||
|
vo.setProjectName(handleData(projectNames));
|
||||||
|
BigDecimal leaseCost = BigDecimal.valueOf(0.00);
|
||||||
|
BigDecimal repairCost = BigDecimal.valueOf(0.00);
|
||||||
|
BigDecimal scrapCost = BigDecimal.valueOf(0.00);
|
||||||
|
BigDecimal loseCost = BigDecimal.valueOf(0.00);
|
||||||
|
BigDecimal reducCost = BigDecimal.valueOf(0.00);
|
||||||
|
//租赁费用列表
|
||||||
|
List<MaterialSltAgreementInfo> leaseList = new ArrayList<>();
|
||||||
|
//维修费用列表
|
||||||
|
List<MaterialSltAgreementInfo> repairList = new ArrayList<>();
|
||||||
|
//报废费用列表
|
||||||
|
List<MaterialSltAgreementInfo> scrapList = new ArrayList<>();
|
||||||
|
//丢失费用列表
|
||||||
|
List<MaterialSltAgreementInfo> loseList = new ArrayList<>();
|
||||||
|
//减免费用列表
|
||||||
|
List<SltAgreementReduce> reductionList = new ArrayList<>();
|
||||||
|
List<SltAgreementRelation> relations = new ArrayList<>();
|
||||||
|
for (MaterialSltInfoVo infoVo : list) {
|
||||||
|
leaseCost = leaseCost.add(infoVo.getLeaseCost());
|
||||||
|
repairCost = repairCost.add(infoVo.getRepairCost());
|
||||||
|
scrapCost = scrapCost.add(infoVo.getScrapCost());
|
||||||
|
loseCost = loseCost.add(infoVo.getLoseCost());
|
||||||
|
reducCost = reducCost.add(infoVo.getReductionCost());
|
||||||
|
leaseList.addAll(infoVo.getLeaseList());
|
||||||
|
repairList.addAll(infoVo.getRepairList());
|
||||||
|
scrapList.addAll(infoVo.getScrapList());
|
||||||
|
loseList.addAll(infoVo.getLoseList());
|
||||||
|
reductionList.addAll(infoVo.getReductionList());
|
||||||
|
relations.addAll(infoVo.getRelations());
|
||||||
|
}
|
||||||
|
vo.setLeaseList(leaseList);
|
||||||
|
vo.setRepairList(repairList);
|
||||||
|
vo.setScrapList(scrapList);
|
||||||
|
vo.setLoseList(loseList);
|
||||||
|
vo.setReductionList(reductionList);
|
||||||
|
vo.setLeaseCost(leaseCost);
|
||||||
|
vo.setRepairCost(repairCost);
|
||||||
|
vo.setScrapCost(scrapCost);
|
||||||
|
vo.setLoseCost(loseCost);
|
||||||
|
vo.setReductionCost(reducCost);
|
||||||
|
vo.setRelations(relations);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String handleData(List<String> list) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
Set<String> set = new HashSet<>(list);
|
||||||
|
for (String str : set) {
|
||||||
|
sb.append(str).append("、");
|
||||||
|
}
|
||||||
|
return StringUtils.removeEnd(sb.toString(), "、");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工程下拉框
|
* 工程下拉框
|
||||||
*
|
*
|
||||||
|
|
@ -169,7 +216,7 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getAgreementInfoById(SelectDto dto) {
|
public AjaxResult getAgreementInfoById(SelectDto dto) {
|
||||||
List<AgreementVo> vo = new ArrayList<>();
|
List<AgreementVo> vo;
|
||||||
try {
|
try {
|
||||||
List<AgreementVo> list = clzSltAgreementInfoMapper.getAgreementInfoById(dto.getUnitIds(), Integer.parseInt(dto.getProjectId()));
|
List<AgreementVo> list = clzSltAgreementInfoMapper.getAgreementInfoById(dto.getUnitIds(), Integer.parseInt(dto.getProjectId()));
|
||||||
if (CollectionUtils.isNotEmpty(list)) {
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
|
@ -191,7 +238,7 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
||||||
@Override
|
@Override
|
||||||
public int submitCosts(MaterialSltInfoVo sltInfoVo) {
|
public int submitCosts(MaterialSltInfoVo sltInfoVo) {
|
||||||
try {
|
try {
|
||||||
if(sltInfoVo.getAgreementIds()!=null) {
|
if (sltInfoVo.getAgreementIds() != null) {
|
||||||
|
|
||||||
for (Long agreementId : sltInfoVo.getAgreementIds()) {
|
for (Long agreementId : sltInfoVo.getAgreementIds()) {
|
||||||
Long id = null;
|
Long id = null;
|
||||||
|
|
@ -260,7 +307,7 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
||||||
throw new ServiceException("bm_agreement_info修改失败");
|
throw new ServiceException("bm_agreement_info修改失败");
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
if (sltInfoVo.getLeaseList().size() > 0) {
|
if (!sltInfoVo.getLeaseList().isEmpty()) {
|
||||||
List<MaterialSltAgreementInfo> filteredLeaseList = sltInfoVo.getLeaseList().stream()
|
List<MaterialSltAgreementInfo> filteredLeaseList = sltInfoVo.getLeaseList().stream()
|
||||||
.filter(lease -> lease.getAgreementId().equals(sltInfoVo.getAgreementId()))
|
.filter(lease -> lease.getAgreementId().equals(sltInfoVo.getAgreementId()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
@ -284,7 +331,7 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
||||||
clzSltAgreementInfoMapper.insertSltAgreementDetailScrap(filteredScrapList, id);
|
clzSltAgreementInfoMapper.insertSltAgreementDetailScrap(filteredScrapList, id);
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
if (sltInfoVo.getLoseList().size() > 0) {
|
if (!sltInfoVo.getLoseList().isEmpty()) {
|
||||||
List<MaterialSltAgreementInfo> filteredLoseList = sltInfoVo.getLoseList().stream()
|
List<MaterialSltAgreementInfo> filteredLoseList = sltInfoVo.getLoseList().stream()
|
||||||
.filter(lease -> lease.getAgreementId().equals(sltInfoVo.getAgreementId()))
|
.filter(lease -> lease.getAgreementId().equals(sltInfoVo.getAgreementId()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
@ -302,23 +349,22 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取结算关系列表
|
* 获取结算关系列表
|
||||||
* @param leaseList
|
* @param leaseList 领料数据
|
||||||
* @param repairList
|
* @param repairList 维修数据
|
||||||
* @param scrapList
|
* @param scrapList 报废数据
|
||||||
* @param loseList
|
* @param loseList 丢失数据
|
||||||
* @param sltInfo
|
* @param sltInfo 结算信息
|
||||||
* @return
|
* @return 协议费用列表
|
||||||
*/
|
*/
|
||||||
private List<SltAgreementRelation> getRelations(List<MaterialSltAgreementInfo> leaseList, List<MaterialSltAgreementInfo> repairList, List<MaterialSltAgreementInfo> scrapList, List<MaterialSltAgreementInfo> loseList, MaterialSltAgreementInfo sltInfo) {
|
private List<SltAgreementRelation> getRelations(List<MaterialSltAgreementInfo> leaseList, List<MaterialSltAgreementInfo> repairList, List<MaterialSltAgreementInfo> scrapList, List<MaterialSltAgreementInfo> loseList, MaterialSltAgreementInfo sltInfo) {
|
||||||
List<SltAgreementRelation> relations = new ArrayList<>();
|
List<SltAgreementRelation> relations = new ArrayList<>();
|
||||||
// for (SltAgreementInfo info : list) {
|
|
||||||
SltAgreementRelation relation = new SltAgreementRelation();
|
SltAgreementRelation relation = new SltAgreementRelation();
|
||||||
BigDecimal loseCost = BigDecimal.ZERO;
|
BigDecimal loseCost = BigDecimal.ZERO;
|
||||||
BigDecimal leaseCost = BigDecimal.ZERO;
|
BigDecimal leaseCost = BigDecimal.ZERO;
|
||||||
BigDecimal scrapCost = BigDecimal.ZERO;
|
BigDecimal scrapCost = BigDecimal.ZERO;
|
||||||
BigDecimal repairCost = BigDecimal.ZERO;
|
BigDecimal repairCost = BigDecimal.ZERO;
|
||||||
for (MaterialSltAgreementInfo lease : leaseList) {
|
for (MaterialSltAgreementInfo lease : leaseList) {
|
||||||
if (lease.getAgreementId().equals(sltInfo.getAgreementId().toString())) {
|
if (lease.getAgreementId().equals(sltInfo.getAgreementId())) {
|
||||||
relation.setAgreementId(String.valueOf(lease.getAgreementId()));
|
relation.setAgreementId(String.valueOf(lease.getAgreementId()));
|
||||||
relation.setProjectName(lease.getProjectName());
|
relation.setProjectName(lease.getProjectName());
|
||||||
relation.setUnitName(lease.getUnitName());
|
relation.setUnitName(lease.getUnitName());
|
||||||
|
|
@ -328,19 +374,19 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (MaterialSltAgreementInfo repair : repairList) {
|
for (MaterialSltAgreementInfo repair : repairList) {
|
||||||
if (repair.getAgreementId().equals(sltInfo.getAgreementId().toString())) {
|
if (repair.getAgreementId().equals(sltInfo.getAgreementId())) {
|
||||||
BigDecimal cost = repair.getCosts();
|
BigDecimal cost = repair.getCosts();
|
||||||
repairCost = repairCost.add(cost);
|
repairCost = repairCost.add(cost);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (MaterialSltAgreementInfo scrap : scrapList) {
|
for (MaterialSltAgreementInfo scrap : scrapList) {
|
||||||
if (scrap.getAgreementId().equals(sltInfo.getAgreementId().toString())) {
|
if (scrap.getAgreementId().equals(sltInfo.getAgreementId())) {
|
||||||
BigDecimal cost = scrap.getCosts();
|
BigDecimal cost = scrap.getCosts();
|
||||||
scrapCost = scrapCost.add(cost);
|
scrapCost = scrapCost.add(cost);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (MaterialSltAgreementInfo lose : loseList) {
|
for (MaterialSltAgreementInfo lose : loseList) {
|
||||||
if (lose.getAgreementId().equals(sltInfo.getAgreementId().toString())) {
|
if (lose.getAgreementId().equals(sltInfo.getAgreementId())) {
|
||||||
//TODO 上面已经set过值,这里为什么还要set值
|
//TODO 上面已经set过值,这里为什么还要set值
|
||||||
relation.setAgreementId(String.valueOf(lose.getAgreementId()));
|
relation.setAgreementId(String.valueOf(lose.getAgreementId()));
|
||||||
relation.setProjectName(lose.getProjectName());
|
relation.setProjectName(lose.getProjectName());
|
||||||
|
|
@ -355,14 +401,12 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
||||||
relation.setScrapCost(scrapCost);
|
relation.setScrapCost(scrapCost);
|
||||||
relation.setLoseCost(loseCost);
|
relation.setLoseCost(loseCost);
|
||||||
relations.add(relation);
|
relations.add(relation);
|
||||||
// }
|
|
||||||
return relations;
|
return relations;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取减免费用列表
|
* 获取减免费用列表
|
||||||
* @param info
|
* @param info 信息表
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
private List<SltAgreementReduce> getReductionList(MaterialSltAgreementInfo info) {
|
private List<SltAgreementReduce> getReductionList(MaterialSltAgreementInfo info) {
|
||||||
SltAgreementReduce bean =new SltAgreementReduce();
|
SltAgreementReduce bean =new SltAgreementReduce();
|
||||||
|
|
@ -372,20 +416,17 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取丢失费用列表
|
* 获取丢失费用列表
|
||||||
* @param info
|
* @param info 信息表
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
private List<MaterialSltAgreementInfo> getLoseList(MaterialSltAgreementInfo info) {
|
private List<MaterialSltAgreementInfo> getLoseList(MaterialSltAgreementInfo info) {
|
||||||
List<MaterialSltAgreementInfo> loseList = new ArrayList<>();
|
|
||||||
|
|
||||||
List<MaterialSltAgreementInfo> oneOfList = clzSltAgreementInfoMapper.getLoseList(info);
|
List<MaterialSltAgreementInfo> oneOfList = clzSltAgreementInfoMapper.getLoseList(info);
|
||||||
loseList.addAll(oneOfList);
|
List<MaterialSltAgreementInfo> loseList = new ArrayList<>(oneOfList);
|
||||||
|
|
||||||
for (MaterialSltAgreementInfo bean : loseList) {
|
for (MaterialSltAgreementInfo bean : loseList) {
|
||||||
if (null == bean.getBuyPrice()) {
|
if (Objects.isNull(bean.getBuyPrice())) {
|
||||||
bean.setBuyPrice(BigDecimal.valueOf(0.00));
|
bean.setBuyPrice(BigDecimal.valueOf(0.00));
|
||||||
}
|
}
|
||||||
if (null == bean.getNum()) {
|
if (Objects.isNull(bean.getNum())) {
|
||||||
bean.setNum(BigDecimal.valueOf(0L));
|
bean.setNum(BigDecimal.valueOf(0L));
|
||||||
}
|
}
|
||||||
BigDecimal buyPrice = bean.getBuyPrice();
|
BigDecimal buyPrice = bean.getBuyPrice();
|
||||||
|
|
@ -400,14 +441,11 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取租赁费用列表
|
* 获取租赁费用列表
|
||||||
* @param info
|
* @param info 获取租赁费用列表参数
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
private List<MaterialSltAgreementInfo> getLeaseList(MaterialSltAgreementInfo info) {
|
private List<MaterialSltAgreementInfo> getLeaseList(MaterialSltAgreementInfo info) {
|
||||||
List<MaterialSltAgreementInfo> leaseList = new ArrayList<>();
|
|
||||||
|
|
||||||
List<MaterialSltAgreementInfo> oneOfList = clzSltAgreementInfoMapper.getLeaseList(info);
|
List<MaterialSltAgreementInfo> oneOfList = clzSltAgreementInfoMapper.getLeaseList(info);
|
||||||
leaseList.addAll(oneOfList);
|
List<MaterialSltAgreementInfo> leaseList = new ArrayList<>(oneOfList);
|
||||||
|
|
||||||
for (MaterialSltAgreementInfo bean : leaseList) {
|
for (MaterialSltAgreementInfo bean : leaseList) {
|
||||||
if (null == bean.getLeasePrice()) {
|
if (null == bean.getLeasePrice()) {
|
||||||
|
|
@ -415,10 +453,10 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
||||||
}else{
|
}else{
|
||||||
bean.setLeasePrice(bean.getLeasePrice().setScale(2, RoundingMode.HALF_UP));
|
bean.setLeasePrice(bean.getLeasePrice().setScale(2, RoundingMode.HALF_UP));
|
||||||
}
|
}
|
||||||
if (null == bean.getNum()) {
|
if (Objects.isNull(bean.getNum())) {
|
||||||
bean.setNum(BigDecimal.valueOf(0L));
|
bean.setNum(BigDecimal.valueOf(0L));
|
||||||
}
|
}
|
||||||
if (null == bean.getLeaseDays()) {
|
if (Objects.isNull(bean.getLeaseDays())) {
|
||||||
bean.setLeaseDay(0L);
|
bean.setLeaseDay(0L);
|
||||||
}
|
}
|
||||||
BigDecimal leasePrice = bean.getLeasePrice();
|
BigDecimal leasePrice = bean.getLeasePrice();
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,12 @@ public class SelectController {
|
||||||
return service.getDeviceTypeTree(dto);
|
return service.getDeviceTypeTree(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "退料设备类型树")
|
||||||
|
@PostMapping("getBackDeviceTypeTree")
|
||||||
|
public AjaxResult getBackDeviceTypeTree(@RequestBody SelectDto dto){
|
||||||
|
return service.getBackDeviceTypeTree(dto);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "资产属性")
|
@ApiOperation(value = "资产属性")
|
||||||
@PostMapping("getAssetAttributesCbx")
|
@PostMapping("getAssetAttributesCbx")
|
||||||
public AjaxResult getAssetAttributesCbx(@RequestBody SelectDto dto){
|
public AjaxResult getAssetAttributesCbx(@RequestBody SelectDto dto){
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,8 @@ public interface SelectMapper {
|
||||||
*/
|
*/
|
||||||
List<TreeNode> getDeviceTypeTree(SelectDto dto);
|
List<TreeNode> getDeviceTypeTree(SelectDto dto);
|
||||||
|
|
||||||
|
List<TreeNode> getBackDeviceTypeTree(SelectDto dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 资产属性
|
* 资产属性
|
||||||
* @param dto
|
* @param dto
|
||||||
|
|
@ -126,6 +128,8 @@ public interface SelectMapper {
|
||||||
*/
|
*/
|
||||||
List<TypeTreeNode> getUseTypeTreeL4(BackApplyInfo bean);
|
List<TypeTreeNode> getUseTypeTreeL4(BackApplyInfo bean);
|
||||||
|
|
||||||
|
List<TypeTreeNode> getUseTypeTreeL4Back(SelectDto bean);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在用设备类型树3级
|
* 在用设备类型树3级
|
||||||
* @param list
|
* @param list
|
||||||
|
|
@ -133,6 +137,7 @@ public interface SelectMapper {
|
||||||
*/
|
*/
|
||||||
List<TypeTreeNode> getUseTypeTreeL3(List<Long> list);
|
List<TypeTreeNode> getUseTypeTreeL3(List<Long> list);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在用设备类型树2级
|
* 在用设备类型树2级
|
||||||
* @param list
|
* @param list
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,8 @@ public interface SelectService {
|
||||||
*/
|
*/
|
||||||
AjaxResult getDeviceTypeTree(SelectDto dto);
|
AjaxResult getDeviceTypeTree(SelectDto dto);
|
||||||
|
|
||||||
|
AjaxResult getBackDeviceTypeTree(SelectDto dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 资产属性
|
* 资产属性
|
||||||
* @param dto
|
* @param dto
|
||||||
|
|
|
||||||
|
|
@ -370,6 +370,68 @@ public class SelectServiceImpl implements SelectService {
|
||||||
return AjaxResult.success(groupList);
|
return AjaxResult.success(groupList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult getBackDeviceTypeTree(SelectDto dto) {
|
||||||
|
List<TypeTreeNode> groupList = new ArrayList<>();
|
||||||
|
List<TypeTreeNode> list = new ArrayList<>();
|
||||||
|
List<TypeTreeNode> listL4 = new ArrayList<>();
|
||||||
|
List<TypeTreeNode> listL3 = new ArrayList<>();
|
||||||
|
List<TypeTreeNode> listL21 = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
// 先查第四层类型
|
||||||
|
listL4 = mapper.getUseTypeTreeL4Back(dto);
|
||||||
|
if (CollectionUtils.isNotEmpty(listL4)) {
|
||||||
|
List<Long> list4ParentIds = listL4.stream().map(o -> o.getParentId()).collect(Collectors.toList());
|
||||||
|
// 根据第四层parentId 查第三层类型
|
||||||
|
listL3 = mapper.getUseTypeTreeL3(list4ParentIds);
|
||||||
|
List<Long> list3ParentIds = listL3.stream().map(o -> o.getParentId()).collect(Collectors.toList());
|
||||||
|
// 根据第三层parentId 查第1.2层类型
|
||||||
|
listL21 = mapper.getUseTypeTreeL21(list3ParentIds);
|
||||||
|
list.addAll(listL4);
|
||||||
|
list.addAll(listL3);
|
||||||
|
list.addAll(listL21);
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
// 创建树形结构(数据集合作为参数)
|
||||||
|
TypeTreeBuild treeBuild = new TypeTreeBuild(list);
|
||||||
|
// 原查询结果转换树形结构
|
||||||
|
groupList = treeBuild.buildTree();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
AjaxResult.error("类型树-查询失败", e);
|
||||||
|
}
|
||||||
|
return AjaxResult.success(groupList);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// List<TreeNode> groupList = new ArrayList<>();
|
||||||
|
// List<TreeNode> list = new ArrayList<>();
|
||||||
|
// try {
|
||||||
|
// list = mapper.getBackDeviceTypeTree(dto);
|
||||||
|
// if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
// // 创建树形结构(数据集合作为参数)
|
||||||
|
// TreeBuild treeBuild = new TreeBuild(list);
|
||||||
|
// // 原查询结果转换树形结构
|
||||||
|
// groupList = treeBuild.buildTree();
|
||||||
|
// }
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// log.error("单位树/归属部门/所属上级-查询失败", e);
|
||||||
|
// }
|
||||||
|
// return AjaxResult.success(groupList);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getAssetAttributesCbx(SelectDto dto) {
|
public AjaxResult getAssetAttributesCbx(SelectDto dto) {
|
||||||
List<SelectVo> list = new ArrayList<>();
|
List<SelectVo> list = new ArrayList<>();
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,7 @@ public class SltAgreementInfoController extends BaseController {
|
||||||
}
|
}
|
||||||
return AjaxResult.success(bean);
|
return AjaxResult.success(bean);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SltInfoVo mergerData(SltInfoVo vo,List<SltInfoVo> list,List<String> unitNames,List<String> projectNames){
|
public SltInfoVo mergerData(SltInfoVo vo,List<SltInfoVo> list,List<String> unitNames,List<String> projectNames){
|
||||||
vo.setUnitName(handleData(unitNames));
|
vo.setUnitName(handleData(unitNames));
|
||||||
vo.setProjectName(handleData(projectNames));
|
vo.setProjectName(handleData(projectNames));
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="typeId != null">
|
<if test="typeId != null">
|
||||||
and mm.type_id = #{typeId}
|
and mm.type_id = #{typeId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="keyWord != null and keyWord != ''">
|
||||||
|
and (
|
||||||
|
mm.ma_code like concat('%', #{keyWord}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
GROUP BY mm.ma_code
|
GROUP BY mm.ma_code
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -337,6 +342,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
ba.agreement_id AS agreementId
|
ba.agreement_id AS agreementId
|
||||||
FROM slt_agreement_info sai
|
FROM slt_agreement_info sai
|
||||||
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
|
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
|
||||||
|
LEFT JOIN ma_type_repair mtr ON mm.type_id = mtr.type_id
|
||||||
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
|
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
|
||||||
AND mt.del_flag = '0'
|
AND mt.del_flag = '0'
|
||||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||||
|
|
@ -350,6 +356,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
|
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
|
||||||
AND bu.del_flag = '0'
|
AND bu.del_flag = '0'
|
||||||
WHERE sai.`status`=0 and mm.ma_status = '2'
|
WHERE sai.`status`=0 and mm.ma_status = '2'
|
||||||
|
and mtr.user_id = #{userId}
|
||||||
and mm.ma_code = #{maCode}
|
and mm.ma_code = #{maCode}
|
||||||
AND ba.unit_id = #{unitId}
|
AND ba.unit_id = #{unitId}
|
||||||
AND ba.project_id = #{proId}
|
AND ba.project_id = #{proId}
|
||||||
|
|
@ -428,6 +435,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
FROM
|
FROM
|
||||||
slt_agreement_info sai
|
slt_agreement_info sai
|
||||||
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
|
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
|
||||||
|
LEFT JOIN ma_type_repair mtr ON mm.type_id = mtr.type_id
|
||||||
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
|
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
|
||||||
AND mt.del_flag = '0'
|
AND mt.del_flag = '0'
|
||||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||||
|
|
@ -442,6 +450,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
AND bu.del_flag = '0'
|
AND bu.del_flag = '0'
|
||||||
WHERE
|
WHERE
|
||||||
sai.`status`=0 and mm.qr_code = #{qrCode}
|
sai.`status`=0 and mm.qr_code = #{qrCode}
|
||||||
|
and mtr.user_id = #{userId}
|
||||||
<if test="agreementId != null">
|
<if test="agreementId != null">
|
||||||
AND ba.unit_id = #{unitId}
|
AND ba.unit_id = #{unitId}
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -813,7 +822,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<update id="uploadSort">
|
<update id="uploadSort">
|
||||||
update bm_handling_order
|
update bm_handling_order
|
||||||
set sort = #{sort},time_type = #{timeType},queue_date=#{reserveDate}
|
set sort = #{sort},time_type = #{timeType},queue_date=#{reserveDate},update_time = now(),update_by = #{updateBy}
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
@ -1059,9 +1068,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
bho.time_type as timeType,
|
bho.time_type as timeType,
|
||||||
bho.sort,
|
bho.sort,
|
||||||
bho.type,
|
bho.type,
|
||||||
bho.reserve_date as reserveDate
|
bho.reserve_date as reserveDate,
|
||||||
|
su.sign_url as signUrl
|
||||||
FROM bm_handling_order bho
|
FROM bm_handling_order bho
|
||||||
LEFT JOIN bm_project bp on bp.pro_id = bho.pro_id
|
LEFT JOIN bm_project bp on bp.pro_id = bho.pro_id
|
||||||
|
LEFT JOIN sys_user su on su.user_id=bho.update_by
|
||||||
WHERE bho.is_active = '1'
|
WHERE bho.is_active = '1'
|
||||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||||
and bho.reserve_date BETWEEN #{startTime} AND #{endTime}
|
and bho.reserve_date BETWEEN #{startTime} AND #{endTime}
|
||||||
|
|
@ -1074,13 +1085,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
bho.type like concat('%',#{keyWord},'%')
|
bho.type like concat('%',#{keyWord},'%')
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
ORDER BY bho.update_time desc,bho.sort desc
|
||||||
</select>
|
</select>
|
||||||
<select id="selectSort" resultType="java.lang.Integer">
|
<select id="selectSort" resultType="java.lang.Integer">
|
||||||
SELECT count(*)
|
SELECT count(*)
|
||||||
FROM bm_handling_order
|
FROM bm_handling_order
|
||||||
WHERE sort = #{sort}
|
WHERE sort = #{sort}
|
||||||
and time_type=#{timeType}
|
|
||||||
and queue_date=#{reserveDate}
|
and queue_date=#{reserveDate}
|
||||||
and is_active = '1'
|
and is_active = '1'
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
|
|
@ -464,7 +464,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<!-- left join `uni_org`.org_user org_user on bzgl_bz.bzz_idcard = org_user.id_card-->
|
<!-- left join `uni_org`.org_user org_user on bzgl_bz.bzz_idcard = org_user.id_card-->
|
||||||
<!-- WHERE bzgl_bz.project_id = #{externalId}-->
|
<!-- WHERE bzgl_bz.project_id = #{externalId}-->
|
||||||
<!-- </select>-->
|
<!-- </select>-->
|
||||||
|
<select id="getTeamList" resultType="com.bonus.material.common.domain.vo.SelectVo">
|
||||||
|
SELECT
|
||||||
|
unit_id as id,
|
||||||
|
unit_name AS name
|
||||||
|
FROM
|
||||||
|
bm_unit
|
||||||
|
WHERE
|
||||||
|
del_flag = '0'
|
||||||
|
and type_id = 1731
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getAgreementInfoBy" resultType="com.bonus.material.common.domain.vo.AgreementVo">
|
<select id="getAgreementInfoBy" resultType="com.bonus.material.common.domain.vo.AgreementVo">
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -673,16 +682,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEVEL
|
LEVEL
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getTeamList" resultType="com.bonus.common.biz.domain.ProjectTreeNode">
|
|
||||||
SELECT
|
|
||||||
unit_id as id,
|
|
||||||
unit_name AS name
|
|
||||||
FROM
|
|
||||||
bm_unit
|
|
||||||
WHERE
|
|
||||||
del_flag = '0'
|
|
||||||
and type_id = 1731
|
|
||||||
</select>
|
|
||||||
<select id="getUnitListPro" resultType="com.bonus.common.biz.domain.ProjectTreeNode">
|
<select id="getUnitListPro" resultType="com.bonus.common.biz.domain.ProjectTreeNode">
|
||||||
/*根据标段工程id查询无需授权的项目部和后勤*/
|
/*根据标段工程id查询无需授权的项目部和后勤*/
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -760,4 +759,57 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
FROM pro_authorize_info
|
FROM pro_authorize_info
|
||||||
WHERE lease_id = #{leaseId}
|
WHERE lease_id = #{leaseId}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getBackDeviceTypeTree" resultType="com.bonus.common.biz.domain.TreeNode">
|
||||||
|
SELECT mt.type_id AS id,
|
||||||
|
mt.type_name AS label,
|
||||||
|
CASE WHEN mt.level = '3' THEN '0' ELSE mt.parent_id END AS parentId,
|
||||||
|
mt.unit_name AS unitName,
|
||||||
|
mt.model_code AS modelCode,
|
||||||
|
mt.manage_type AS manageType
|
||||||
|
FROM ma_type mt
|
||||||
|
INNER join (SELECT
|
||||||
|
mm.type_id AS type_id,
|
||||||
|
mt2.type_name AS typeName,
|
||||||
|
mt.type_name AS typeModelName
|
||||||
|
FROM
|
||||||
|
slt_agreement_info sai
|
||||||
|
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
|
||||||
|
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
|
||||||
|
AND mt.del_flag = '0'
|
||||||
|
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
||||||
|
AND mt2.del_flag = '0'
|
||||||
|
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
|
||||||
|
WHERE
|
||||||
|
mm.ma_status = '2'
|
||||||
|
AND ba.unit_id = #{unitId}
|
||||||
|
AND ba.project_id = #{proId}
|
||||||
|
GROUP BY mm.type_id) AS subquery0 ON subquery0.type_id = mt.type_id
|
||||||
|
WHERE mt.del_flag = '0'
|
||||||
|
|
||||||
|
AND mt.level IN ('3','4')
|
||||||
|
|
||||||
|
|
||||||
|
</select>
|
||||||
|
<select id="getUseTypeTreeL4Back" resultType="com.bonus.common.biz.domain.TypeTreeNode">
|
||||||
|
SELECT
|
||||||
|
mt.type_id AS typeId,
|
||||||
|
mt1.type_name as materialName,
|
||||||
|
mt.type_name as typeName,
|
||||||
|
mt.parent_id as parentId,
|
||||||
|
mt.LEVEL as level
|
||||||
|
|
||||||
|
FROM
|
||||||
|
slt_agreement_info sai
|
||||||
|
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
|
||||||
|
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
|
||||||
|
AND mt.del_flag = '0'
|
||||||
|
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||||
|
AND mt1.del_flag = '0'
|
||||||
|
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
|
||||||
|
WHERE
|
||||||
|
mm.ma_status = '2'
|
||||||
|
AND ba.unit_id = #{unitId}
|
||||||
|
AND ba.project_id = #{proId}
|
||||||
|
GROUP BY mm.type_id
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue