Merge remote-tracking branch 'origin/master'

This commit is contained in:
jiang 2025-07-30 18:28:08 +08:00
commit 0f29e252bc
15 changed files with 351 additions and 159 deletions

View File

@ -16,10 +16,7 @@ import com.bonus.material.archives.service.ArchivesService;
import com.bonus.material.back.domain.BackApplyDetails;
import com.bonus.material.back.domain.HandlingOrder;
import com.bonus.material.back.domain.MaCode;
import com.bonus.material.back.domain.vo.BackAppRequestVo;
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.back.domain.vo.*;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.system.api.RemoteFileService;
import io.swagger.annotations.Api;
@ -207,6 +204,20 @@ public class BackApplyInfoController extends BaseController {
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根据设备编码去检索领料详情
* @param dto

View File

@ -129,4 +129,5 @@ public class BackApplyDetails extends BaseEntity {
@ApiModelProperty(value = "一级类型id")
private Long firstId;
List<MaCodeDto> maVos;
}

View File

@ -39,7 +39,7 @@ public class HandlingOrder implements Serializable {
private String phone;
@ApiModelProperty(value = "排序")
private Integer sort;
private String sort;
/**
* 创建人
@ -79,4 +79,6 @@ public class HandlingOrder implements Serializable {
private String endTime;
private String signUrl;
}

View File

@ -7,10 +7,7 @@ import com.bonus.material.back.domain.BackApplyDetails;
import com.bonus.material.back.domain.BackApplyInfo;
import com.bonus.material.back.domain.HandlingOrder;
import com.bonus.material.back.domain.MaCode;
import com.bonus.material.back.domain.vo.BackAppRequestVo;
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.back.domain.vo.*;
/**
* 退料任务Service接口
@ -160,6 +157,8 @@ public interface IBackApplyInfoService {
*/
AjaxResult selectMachineById(BackApplyInfo dto);
List<MaCodeVo> selectMachineByIdList(BackApplyInfo dto);
/**
* APP删除退料任务
* @param id

View File

@ -1200,7 +1200,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
BackApplyDetails details = dto.getBackApplyDetails();
details.setCode(dto.getBackApplyInfo().getCode());
details.setParentId(dto.getBackApplyInfo().getId());
details.setPreNum(BigDecimal.valueOf(1));
details.setPreNum(BigDecimal.valueOf(dto.getBackApplyDetails().getMaVos().size()));
details.setAuditNum(details.getPreNum());
details.setNum(BigDecimal.valueOf(num));
details.setGoodNum(details.getGoodNum());
@ -1221,6 +1221,11 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
setCommonFields(details, dto.getBackApplyInfo().getId());
// 插入 CheckDetails
//根据id查询back_check_details表看数据是否存在存在则对数量进行更新不存在则插入
for(MaCodeDto maCodeDto : details.getMaVos()){
BackApplyDetails backInfo = new BackApplyDetails();
backInfo = details;
backInfo.setMaId(maCodeDto.getMaId());
backInfo.setMaCode(maCodeDto.getMaCode());
BackApplyDetails checkDetails = backApplyInfoMapper.selectCheckDetails(details);
if (checkDetails != null) {
checkDetails.setId(checkDetails.getId());
@ -1228,18 +1233,30 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
} else {
result += backApplyInfoMapper.insertCheckDetails(details);
}
//更新ma_machine表状态为3退料检修
// result += machineMapper.updateStatus(details.getMaId(), MaMachineStatusEnum.BACK_REPAIR.getStatus());
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(details.getMaId());
bmFileInfo.setModelId(backInfo.getMaId());
result += bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
}
}
}
//更新ma_machine表状态为3退料检修
// result += machineMapper.updateStatus(details.getMaId(), MaMachineStatusEnum.BACK_REPAIR.getStatus());
// 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(details.getMaId());
// result += bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
// }
// }
return result;
}
@ -1354,10 +1371,18 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
}
//判断输入或者编码识别或者二维码识别是否为领料工程和单位对应
List<MaCodeVo> list = new ArrayList<>();
dto.setUserId(SecurityUtils.getLoginUser().getUserid());
if (dto.getMaCode() != null) {
list = backApplyInfoMapper.getMachine(dto);
if (CollectionUtils.isEmpty(list)) {
return AjaxResult.error("该编码非您负责的设备,请重新选择");
}
} else if (dto.getQrCode() != null) {
list = backApplyInfoMapper.getMachineByQrCode(dto);
if (CollectionUtils.isEmpty(list)) {
return AjaxResult.error("该编码非您负责的设备,请重新选择");
}
}
if (CollectionUtils.isNotEmpty(list)) {
for (MaCodeVo maCodeVo : list) {
@ -1632,6 +1657,24 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
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删除退料任务
* @param id
@ -1681,7 +1724,15 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
@Override
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
@ -1693,6 +1744,8 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
if (re > 0) {
return AjaxResult.error("今日该号已存在");
}
Long userId = SecurityUtils.getLoginUser().getUserid();
bean.setUpdateBy(userId.toString());
int res = backApplyInfoMapper.uploadSort(bean);
if (res > 0) {
return AjaxResult.success("排号成功");
@ -1798,23 +1851,23 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
HandlingOrder beans = new HandlingOrder();
String timeTypes = "";
try {
//判断现在是上午还是下午上午为A下午为B
Calendar calendar = Calendar.getInstance();
int hour = calendar.get(Calendar.HOUR_OF_DAY);
String timeType = (hour < 12) ? "A" : "B";
timeTypes = timeType;
bean.setTimeType(timeType);
bean.setReserveDate(DateUtils.getDate());
//查询当前的排号
HandlingOrder bean1 = backApplyInfoMapper.getSort(bean);
if (bean1 != null && bean1.getSort() != null) {
Integer sort = bean1.getSort() + 1;
beans.setSort(sort);
beans.setTimeType(timeType);
} else {
beans.setTimeType(timeType);
beans.setSort(1);
}
// //判断现在是上午还是下午上午为A下午为B
// Calendar calendar = Calendar.getInstance();
// int hour = calendar.get(Calendar.HOUR_OF_DAY);
// String timeType = (hour < 12) ? "A" : "B";
// timeTypes = timeType;
// bean.setTimeType(timeType);
// bean.setReserveDate(DateUtils.getDate());
// //查询当前的排号
// HandlingOrder bean1 = backApplyInfoMapper.getSort(bean);
// if (bean1 != null && bean1.getSort() != null) {
// Integer sort = bean1.getSort() + 1;
// beans.setSort(sort);
// beans.setTimeType(timeType);
// } else {
// beans.setTimeType(timeType);
// beans.setSort(1);
// }
return AjaxResult.success(beans);
} catch (Exception e) {
log.error("获取排号失败", e);

View File

@ -79,7 +79,7 @@ public class ClzSltAgreementInfoController extends BaseController {
dataList.add(vo);
agreementId = info.getAgreementId();
}
bean = mergerData(bean, dataList,unitNames,projectNames);
bean = clzSltAgreementInfoService.mergerData(bean, dataList,unitNames,projectNames);
// 根据协议id获取申请时间
TmTask tmTask = taskMapper.selectTaskByIdByCl(agreementId);
if (tmTask != null) {
@ -88,60 +88,6 @@ public class ClzSltAgreementInfoController extends BaseController {
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(), "");
}
/**
* 提交结算清单

View File

@ -28,6 +28,10 @@ public interface ClzSltAgreementInfoService {
*/
MaterialSltInfoVo getSltInfo(MaterialSltAgreementInfo info);
MaterialSltInfoVo mergerData(MaterialSltInfoVo vo, List<MaterialSltInfoVo> list, List<String> unitNames, List<String> projectNames);
String handleData(List<String> list);
/**
* 工程下拉框
*

View File

@ -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.SltAgreementRelation;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -36,8 +37,7 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
/**
* 根据条件获取协议结算列表
* @param bean
* @return
* @param bean 查询条件
*/
@Override
public List<MaterialSltAgreementInfo> getSltAgreementInfo4Project(MaterialSltAgreementInfo bean) {
@ -79,16 +79,6 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
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) {
if(lose.getCosts()!=null){
loseCost = loseCost.add(lose.getCosts());
@ -109,6 +99,63 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
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
public AjaxResult getAgreementInfoById(SelectDto dto) {
List<AgreementVo> vo = new ArrayList<>();
List<AgreementVo> vo;
try {
List<AgreementVo> list = clzSltAgreementInfoMapper.getAgreementInfoById(dto.getUnitIds(), Integer.parseInt(dto.getProjectId()));
if (CollectionUtils.isNotEmpty(list)) {
@ -260,7 +307,7 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
throw new ServiceException("bm_agreement_info修改失败");
}*/
}
if (sltInfoVo.getLeaseList().size() > 0) {
if (!sltInfoVo.getLeaseList().isEmpty()) {
List<MaterialSltAgreementInfo> filteredLeaseList = sltInfoVo.getLeaseList().stream()
.filter(lease -> lease.getAgreementId().equals(sltInfoVo.getAgreementId()))
.collect(Collectors.toList());
@ -284,7 +331,7 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
clzSltAgreementInfoMapper.insertSltAgreementDetailScrap(filteredScrapList, id);
}
}*/
if (sltInfoVo.getLoseList().size() > 0) {
if (!sltInfoVo.getLoseList().isEmpty()) {
List<MaterialSltAgreementInfo> filteredLoseList = sltInfoVo.getLoseList().stream()
.filter(lease -> lease.getAgreementId().equals(sltInfoVo.getAgreementId()))
.collect(Collectors.toList());
@ -302,23 +349,22 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
/**
* 获取结算关系列表
* @param leaseList
* @param repairList
* @param scrapList
* @param loseList
* @param sltInfo
* @return
* @param leaseList 领料数据
* @param repairList 维修数据
* @param scrapList 报废数据
* @param loseList 丢失数据
* @param sltInfo 结算信息
* @return 协议费用列表
*/
private List<SltAgreementRelation> getRelations(List<MaterialSltAgreementInfo> leaseList, List<MaterialSltAgreementInfo> repairList, List<MaterialSltAgreementInfo> scrapList, List<MaterialSltAgreementInfo> loseList, MaterialSltAgreementInfo sltInfo) {
List<SltAgreementRelation> relations = new ArrayList<>();
// for (SltAgreementInfo info : list) {
SltAgreementRelation relation = new SltAgreementRelation();
BigDecimal loseCost = BigDecimal.ZERO;
BigDecimal leaseCost = BigDecimal.ZERO;
BigDecimal scrapCost = BigDecimal.ZERO;
BigDecimal repairCost = BigDecimal.ZERO;
for (MaterialSltAgreementInfo lease : leaseList) {
if (lease.getAgreementId().equals(sltInfo.getAgreementId().toString())) {
if (lease.getAgreementId().equals(sltInfo.getAgreementId())) {
relation.setAgreementId(String.valueOf(lease.getAgreementId()));
relation.setProjectName(lease.getProjectName());
relation.setUnitName(lease.getUnitName());
@ -328,19 +374,19 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
}
}
for (MaterialSltAgreementInfo repair : repairList) {
if (repair.getAgreementId().equals(sltInfo.getAgreementId().toString())) {
if (repair.getAgreementId().equals(sltInfo.getAgreementId())) {
BigDecimal cost = repair.getCosts();
repairCost = repairCost.add(cost);
}
}
for (MaterialSltAgreementInfo scrap : scrapList) {
if (scrap.getAgreementId().equals(sltInfo.getAgreementId().toString())) {
if (scrap.getAgreementId().equals(sltInfo.getAgreementId())) {
BigDecimal cost = scrap.getCosts();
scrapCost = scrapCost.add(cost);
}
}
for (MaterialSltAgreementInfo lose : loseList) {
if (lose.getAgreementId().equals(sltInfo.getAgreementId().toString())) {
if (lose.getAgreementId().equals(sltInfo.getAgreementId())) {
//TODO 上面已经set过值这里为什么还要set值
relation.setAgreementId(String.valueOf(lose.getAgreementId()));
relation.setProjectName(lose.getProjectName());
@ -355,14 +401,12 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
relation.setScrapCost(scrapCost);
relation.setLoseCost(loseCost);
relations.add(relation);
// }
return relations;
}
/**
* 获取减免费用列表
* @param info
* @return
* @param info 信息表
*/
private List<SltAgreementReduce> getReductionList(MaterialSltAgreementInfo info) {
SltAgreementReduce bean =new SltAgreementReduce();
@ -372,20 +416,17 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
/**
* 获取丢失费用列表
* @param info
* @return
* @param info 信息表
*/
private List<MaterialSltAgreementInfo> getLoseList(MaterialSltAgreementInfo info) {
List<MaterialSltAgreementInfo> loseList = new ArrayList<>();
List<MaterialSltAgreementInfo> oneOfList = clzSltAgreementInfoMapper.getLoseList(info);
loseList.addAll(oneOfList);
List<MaterialSltAgreementInfo> loseList = new ArrayList<>(oneOfList);
for (MaterialSltAgreementInfo bean : loseList) {
if (null == bean.getBuyPrice()) {
if (Objects.isNull(bean.getBuyPrice())) {
bean.setBuyPrice(BigDecimal.valueOf(0.00));
}
if (null == bean.getNum()) {
if (Objects.isNull(bean.getNum())) {
bean.setNum(BigDecimal.valueOf(0L));
}
BigDecimal buyPrice = bean.getBuyPrice();
@ -400,14 +441,11 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
/**
* 获取租赁费用列表
* @param info
* @return
* @param info 获取租赁费用列表参数
*/
private List<MaterialSltAgreementInfo> getLeaseList(MaterialSltAgreementInfo info) {
List<MaterialSltAgreementInfo> leaseList = new ArrayList<>();
List<MaterialSltAgreementInfo> oneOfList = clzSltAgreementInfoMapper.getLeaseList(info);
leaseList.addAll(oneOfList);
List<MaterialSltAgreementInfo> leaseList = new ArrayList<>(oneOfList);
for (MaterialSltAgreementInfo bean : leaseList) {
if (null == bean.getLeasePrice()) {
@ -415,10 +453,10 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
}else{
bean.setLeasePrice(bean.getLeasePrice().setScale(2, RoundingMode.HALF_UP));
}
if (null == bean.getNum()) {
if (Objects.isNull(bean.getNum())) {
bean.setNum(BigDecimal.valueOf(0L));
}
if (null == bean.getLeaseDays()) {
if (Objects.isNull(bean.getLeaseDays())) {
bean.setLeaseDay(0L);
}
BigDecimal leasePrice = bean.getLeasePrice();

View File

@ -139,6 +139,12 @@ public class SelectController {
return service.getDeviceTypeTree(dto);
}
@ApiOperation(value = "退料设备类型树")
@PostMapping("getBackDeviceTypeTree")
public AjaxResult getBackDeviceTypeTree(@RequestBody SelectDto dto){
return service.getBackDeviceTypeTree(dto);
}
@ApiOperation(value = "资产属性")
@PostMapping("getAssetAttributesCbx")
public AjaxResult getAssetAttributesCbx(@RequestBody SelectDto dto){

View File

@ -61,6 +61,8 @@ public interface SelectMapper {
*/
List<TreeNode> getDeviceTypeTree(SelectDto dto);
List<TreeNode> getBackDeviceTypeTree(SelectDto dto);
/**
* 资产属性
* @param dto
@ -126,6 +128,8 @@ public interface SelectMapper {
*/
List<TypeTreeNode> getUseTypeTreeL4(BackApplyInfo bean);
List<TypeTreeNode> getUseTypeTreeL4Back(SelectDto bean);
/**
* 在用设备类型树3级
* @param list
@ -133,6 +137,7 @@ public interface SelectMapper {
*/
List<TypeTreeNode> getUseTypeTreeL3(List<Long> list);
/**
* 在用设备类型树2级
* @param list

View File

@ -103,6 +103,8 @@ public interface SelectService {
*/
AjaxResult getDeviceTypeTree(SelectDto dto);
AjaxResult getBackDeviceTypeTree(SelectDto dto);
/**
* 资产属性
* @param dto

View File

@ -370,6 +370,68 @@ public class SelectServiceImpl implements SelectService {
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
public AjaxResult getAssetAttributesCbx(SelectDto dto) {
List<SelectVo> list = new ArrayList<>();

View File

@ -129,6 +129,7 @@ public class SltAgreementInfoController extends BaseController {
}
return AjaxResult.success(bean);
}
public SltInfoVo mergerData(SltInfoVo vo,List<SltInfoVo> list,List<String> unitNames,List<String> projectNames){
vo.setUnitName(handleData(unitNames));
vo.setProjectName(handleData(projectNames));

View File

@ -141,6 +141,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeId != null">
and mm.type_id = #{typeId}
</if>
<if test="keyWord != null and keyWord != ''">
and (
mm.ma_code like concat('%', #{keyWord}, '%')
)
</if>
GROUP BY mm.ma_code
</select>
@ -337,6 +342,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ba.agreement_id AS agreementId
FROM slt_agreement_info sai
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
AND mt.del_flag = '0'
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
AND bu.del_flag = '0'
WHERE sai.`status`=0 and mm.ma_status = '2'
and mtr.user_id = #{userId}
and mm.ma_code = #{maCode}
AND ba.unit_id = #{unitId}
AND ba.project_id = #{proId}
@ -428,6 +435,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM
slt_agreement_info sai
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
AND mt.del_flag = '0'
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'
WHERE
sai.`status`=0 and mm.qr_code = #{qrCode}
and mtr.user_id = #{userId}
<if test="agreementId != null">
AND ba.unit_id = #{unitId}
</if>
@ -813,7 +822,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="uploadSort">
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}
</update>
@ -1059,9 +1068,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bho.time_type as timeType,
bho.sort,
bho.type,
bho.reserve_date as reserveDate
bho.reserve_date as reserveDate,
su.sign_url as signUrl
FROM bm_handling_order bho
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'
<if test="startTime != null and startTime != '' and endTime != null 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},'%')
)
</if>
ORDER BY bho.update_time desc,bho.sort desc
</select>
<select id="selectSort" resultType="java.lang.Integer">
SELECT count(*)
FROM bm_handling_order
WHERE sort = #{sort}
and time_type=#{timeType}
and queue_date=#{reserveDate}
and is_active = '1'
</select>

View File

@ -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-->
<!-- WHERE bzgl_bz.project_id = #{externalId}-->
<!-- </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
@ -673,16 +682,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEVEL
</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">
/*根据标段工程id查询无需授权的项目部和后勤*/
SELECT
@ -760,4 +759,57 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM pro_authorize_info
WHERE lease_id = #{leaseId}
</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>