From 44ee2888e1f1e9daca3a7d6fd9325493acb3a0b4 Mon Sep 17 00:00:00 2001 From: mashuai Date: Thu, 15 May 2025 18:10:33 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=96=99=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BackApplyInfoController.java | 81 +++++++++- .../material/back/domain/BackApplyInfo.java | 18 ++- .../back/domain/BackApplyTotalInfo.java | 151 ++++++++++++++++++ .../material/back/domain/vo/BackMaCodeVo.java | 55 +++++++ .../material/back/domain/vo/MaCodeVo.java | 6 + .../back/mapper/BackApplyInfoMapper.java | 16 ++ .../back/service/IBackApplyInfoService.java | 20 ++- .../impl/BackApplyInfoServiceImpl.java | 50 ++++-- .../controller/ComplexQueryController.java | 14 +- .../material/basic/domain/StorageInfo.java | 3 - .../material/basic/domain/UseStorageInfo.java | 10 +- .../service/impl/ComplexQueryServiceImpl.java | 62 +------ .../material/common/domain/dto/SelectDto.java | 3 + .../service/impl/SelectServiceImpl.java | 2 +- .../bonus/material/config/MyBatisConfig.java | 2 +- .../com/bonus/material/ma/domain/Machine.java | 14 +- .../com/bonus/material/ma/domain/Type.java | 2 + .../ma/service/impl/MachineServiceImpl.java | 14 +- .../bonus/material/warning/StatisticTask.java | 29 ++-- .../material/back/BackApplyInfoMapper.xml | 128 ++++++++++++--- .../material/basic/ComplexQueryMapper.xml | 92 ++++------- .../mapper/material/common/SelectMapper.xml | 6 +- .../lease/LeaseApplyDetailsMapper.xml | 4 +- .../material/lease/LeaseApplyInfoMapper.xml | 2 + .../mapper/material/ma/MachineMapper.xml | 8 +- .../mapper/material/ma/TypeMapper.xml | 8 +- 26 files changed, 578 insertions(+), 222 deletions(-) create mode 100644 bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/BackApplyTotalInfo.java create mode 100644 bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/vo/BackMaCodeVo.java diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/controller/BackApplyInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/controller/BackApplyInfoController.java index ca5f7076..82d97b94 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/controller/BackApplyInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/controller/BackApplyInfoController.java @@ -7,17 +7,17 @@ import javax.validation.Valid; import javax.validation.constraints.NotNull; import cn.hutool.core.convert.Convert; +import com.alibaba.nacos.common.utils.CollectionUtils; import com.bonus.common.biz.config.ListPagingUtil; import com.bonus.common.biz.domain.lease.LeaseApplyInfo; import com.bonus.common.core.utils.ServletUtils; import com.bonus.common.log.enums.OperaType; import com.bonus.material.back.domain.BackApplyDetails; +import com.bonus.material.back.domain.BackApplyTotalInfo; 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.material.lease.domain.vo.LeaseTotalInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -377,4 +377,77 @@ public class BackApplyInfoController extends BaseController { return error("系统错误, " + e.getMessage()); } } + + /** + * 工器具退料记录 + * @param info + * @return + */ + @ApiOperation(value = "工器具退料记录") + @GetMapping("/getBackInfoDetails") + public AjaxResult getBackInfoDetails(BackApplyTotalInfo info){ + info.setIsExport(1); + startPage(); + List list = backApplyInfoService.getBackInfoDetails(info); + return AjaxResult.success(getDataTable(list)); + } + + /** + * 工器具退料记录不带分页 + * @param info + * @return + */ + @ApiOperation(value = "工器具退料记录不带分页") + @GetMapping("/getBackInfoDetailsNoPageList") + public AjaxResult getBackInfoDetailsNoPageList(BackApplyTotalInfo info){ + info.setIsExport(0); + BackApplyTotalInfo backApplyTotalInfo = new BackApplyTotalInfo(); + List list = backApplyInfoService.getBackInfoDetails(info); + if (CollectionUtils.isNotEmpty(list)) { + backApplyTotalInfo = list.get(0); + } + return AjaxResult.success(backApplyTotalInfo); + } + + /** + * 导出工器具退料记录查询 + * @param response + * @param bean + */ + @ApiOperation("导出工器具退料记录查询") + @PostMapping("/exportBackInfoDetails") + public void exportBackInfoDetails(HttpServletResponse response, BackApplyTotalInfo bean) + { + bean.setIsExport(0); + List list = backApplyInfoService.getBackInfoDetails(bean); + ExcelUtil util = new ExcelUtil<>(BackApplyTotalInfo.class); + util.exportExcel(response, list, "综合查询--工器具退料记录查询"); + } + + /** + * 工器具退料二级页面记录 + * @param info + * @return + */ + @ApiOperation(value = "工器具退料二级页面记录") + @GetMapping("/getSecondBackInfo") + public AjaxResult getSecondBackInfo(BackApplyTotalInfo info){ + startPage(); + List list = backApplyInfoService.getSecondBackInfo(info); + return AjaxResult.success(getDataTable(list)); + } + + /** + * 导出工器具退料二级页面查询 + * @param response + * @param bean + */ + @ApiOperation("导出工器具退料二级页面查询") + @PostMapping("/exportSecondBackInfo") + public void exportSecondBackInfo(HttpServletResponse response, BackApplyTotalInfo bean) + { + List list = backApplyInfoService.getSecondBackInfo(bean); + ExcelUtil util = new ExcelUtil<>(BackMaCodeVo.class); + util.exportExcel(response, list, "综合查询--工器具退料二级页面查询"); + } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/BackApplyInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/BackApplyInfo.java index 5af86255..78904264 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/BackApplyInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/BackApplyInfo.java @@ -39,10 +39,16 @@ public class BackApplyInfo implements Serializable { @ApiModelProperty(value = "单位id") private Long unitId; + @ApiModelProperty(value = "班组id") + private Long teamId; + @ApiModelProperty(value = "单位名称") - @Excel(name = "退料单位") private String unitName; + @ApiModelProperty(value = "单位名称") + @Excel(name = "退料班组") + private String teamName; + @ApiModelProperty(value="工程id") private Long proId; @@ -64,7 +70,7 @@ public class BackApplyInfo implements Serializable { private String materialName; @ApiModelProperty(value = "类型名称") - @Excel(name = "物资类型") + @Excel(name = "工器具类型") private String typeName; /** 任务ID */ @@ -74,7 +80,6 @@ public class BackApplyInfo implements Serializable { /** 退料人 */ @Excel(name = "退料人") @ApiModelProperty(value = "退料人") - @Size(max = 20, message = "退料人长度不能超过20个字符") private String backPerson; private String backSignUrl; @@ -117,7 +122,6 @@ public class BackApplyInfo implements Serializable { private String createBy; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "创建时间", dateFormat = "yyyy-MM-dd HH:mm:ss") private Date createTime; /** 1.机具分公司审核通过,2.机具分公司审批不通过,3.调试分公司审批通过,4.调试分公司审批不通过,5.出库进行中,6.出库完成 */ @@ -134,10 +138,8 @@ public class BackApplyInfo implements Serializable { private Date updateTime; @ApiModelProperty(value = "打印状态") - @Excel(name = "打印状态") private String printStatus; - @Excel(name = "备注") @Size(max = 500, message = "备注长度不能超过500个字符") private String remark; @@ -179,8 +181,8 @@ public class BackApplyInfo implements Serializable { @ApiModelProperty(value = "类型编号") private String typeCode; - /** 规格编号 */ - @ApiModelProperty(value = "规格编号") + /** 规格型号 */ + @ApiModelProperty(value = "规格型号") private String modelCode; @ApiModelProperty(value = "计量单位") diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/BackApplyTotalInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/BackApplyTotalInfo.java new file mode 100644 index 00000000..8ee7f4c3 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/BackApplyTotalInfo.java @@ -0,0 +1,151 @@ +package com.bonus.material.back.domain; + +import com.bonus.common.core.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.ToString; +import lombok.experimental.Accessors; + +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 退料任务对象 back_apply_info + * + * @author xsheng + * @date 2024-10-16 + */ + +@Accessors(chain = true) +@Data +@ToString +public class BackApplyTotalInfo implements Serializable { + + private static final long serialVersionUID = 1L; + + private int isExport; + + /** ID */ + private Long id; + + @ApiModelProperty(value = "工器具名称") + @Excel(name = "工器具名称") + private String materialName; + + @ApiModelProperty(value = "规格型号") + @Excel(name = "规格型号") + private String typeName; + + @ApiModelProperty(value = "协议id") + private Long agreementId; + + @ApiModelProperty(value = "任务类型") + private Integer taskType; + + @ApiModelProperty(value = "单位id") + private Long unitId; + + @ApiModelProperty(value = "班组id") + private Long teamId; + + @ApiModelProperty(value = "计量单位") + @Excel(name = "计量单位") + private String unitName; + + /** 退料数量 */ + @ApiModelProperty(value = "退料数量") + @Excel(name = "退料数量") + private BigDecimal backNum; + + @ApiModelProperty(value = "退料日期") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @Excel(name = "退料日期", width = 20, dateFormat = "yyyy-MM-dd") + private Date backTime; + + @ApiModelProperty(value = "单位名称") + @Excel(name = "退料班组") + private String teamName; + + @ApiModelProperty(value="工程id") + private Long proId; + + @ApiModelProperty(value="工程名称") + @Excel(name = "退料工程") + private String proName; + + /** 退料人 */ + @Excel(name = "退料人") + @ApiModelProperty(value = "退料人") + private String backPerson; + + @Excel(name = "操作人") + @ApiModelProperty(value = "创建人") + private String createBy; + + /** 退料单号 */ + @Excel(name = "退料单号") + @ApiModelProperty(value = "退料单号") + private String code; + + @ApiModelProperty(value = "类型id") + private String typeId; + + @ApiModelProperty(value = "物资类型") + private String materialType; + + /** 任务ID */ + @ApiModelProperty(value = "任务ID") + private Long taskId; + + + private String backSignUrl; + + private Byte backSignType; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @ApiModelProperty(value = "任务状态") + private Integer taskStatus; + + private String updateBy; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + @ApiModelProperty(value = "打印状态") + private String printStatus; + + @ApiModelProperty(value = "机具id") + private Long maId; + + /** 任务ID */ + @ApiModelProperty(value = "任务ID") + private Long parentId; + + /** 直转id */ + @ApiModelProperty(value = "直转id") + private Long directId; + + @ApiModelProperty(value="开始时间") + private String startTime; + + @ApiModelProperty(value="结束时间") + private String endTime; + + @ApiModelProperty(value="关键字") + private String keyWord; + + @ApiModelProperty(value="设备编码") + private String maCode; + + @ApiModelProperty(value = "app退料任务状态,0 未审核 1已审核(包含通过和驳回)") + private Integer appTaskStatus; + + @ApiModelProperty(value = "管理方式(0编号 1计数)") + private String manageType; + +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/vo/BackMaCodeVo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/vo/BackMaCodeVo.java new file mode 100644 index 00000000..f3d41547 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/vo/BackMaCodeVo.java @@ -0,0 +1,55 @@ +package com.bonus.material.back.domain.vo; + +import com.bonus.common.core.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + + +import java.util.Date; + +/** + * 退料编码列表 + * @Author ma_sh + * @create 2025/5/15 14:10 + */ +@Data +public class BackMaCodeVo { + + private Long maId; + + private String typeId; + + private String taskId; + + @ApiModelProperty(value = "物资类型") + private String materialType; + + @ApiModelProperty(value = "机具名称") + @Excel(name = "机具名称") + private String materialName; + + @ApiModelProperty(value = "规格型号") + @Excel(name = "规格型号") + private String typeName; + + @ApiModelProperty(value = "设备编码") + @Excel(name = "设备编码") + private String maCode; + + private String keyWord; + + private String createBy; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @ApiModelProperty(value = "退料人员") + @Excel(name = "退料人员") + private String backPerson; + + @ApiModelProperty(value = "退料时间") + @Excel(name = "退料时间", width = 30, dateFormat = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date backTime; +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/vo/MaCodeVo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/vo/MaCodeVo.java index 31f7ac79..31825d6b 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/vo/MaCodeVo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/vo/MaCodeVo.java @@ -62,6 +62,12 @@ public class MaCodeVo { @ApiModelProperty(value="工程名称") private String proName; + @ApiModelProperty(value = "班组id") + private Long teamId; + + @ApiModelProperty(value = "班组名称") + private String teamName; + @ApiModelProperty(value = "协议ID") private Long agreementId; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/mapper/BackApplyInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/mapper/BackApplyInfoMapper.java index f0e422c6..87850841 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/mapper/BackApplyInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/mapper/BackApplyInfoMapper.java @@ -6,9 +6,11 @@ import java.util.List; import com.bonus.common.biz.domain.lease.LeaseApplyInfo; import com.bonus.material.back.domain.BackApplyDetails; import com.bonus.material.back.domain.BackApplyInfo; +import com.bonus.material.back.domain.BackApplyTotalInfo; import com.bonus.material.back.domain.MaCodeDto; import com.bonus.material.back.domain.vo.BackApplyInfoVo; import com.bonus.material.back.domain.vo.BackApplyVo; +import com.bonus.material.back.domain.vo.BackMaCodeVo; import com.bonus.material.back.domain.vo.MaCodeVo; import com.bonus.material.settlement.domain.SltAgreementInfo; import org.apache.ibatis.annotations.Param; @@ -373,4 +375,18 @@ public interface BackApplyInfoMapper { * @return */ List getDetailsList(BackApplyInfo backApplyInfo); + + /** + * 工器具退料记录 + * @param info + * @return + */ + List getBackInfoDetails(BackApplyTotalInfo info); + + /** + * 工器具退料二级页面记录 + * @param info + * @return + */ + List getSecondBackInfo(BackApplyTotalInfo info); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/IBackApplyInfoService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/IBackApplyInfoService.java index e3947b9f..8b87511a 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/IBackApplyInfoService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/IBackApplyInfoService.java @@ -6,11 +6,9 @@ import com.bonus.common.biz.domain.lease.LeaseApplyInfo; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.material.back.domain.BackApplyDetails; import com.bonus.material.back.domain.BackApplyInfo; +import com.bonus.material.back.domain.BackApplyTotalInfo; 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接口 @@ -166,5 +164,19 @@ public interface IBackApplyInfoService { * @return */ List getDetailsList(BackApplyInfo backApplyInfo); + + /** + * 工器具退料记录 + * @param info + * @return + */ + List getBackInfoDetails(BackApplyTotalInfo info); + + /** + * 工器具退料二级页面记录 + * @param info + * @return + */ + List getSecondBackInfo(BackApplyTotalInfo info); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java index 0ae3de44..9fbaddb7 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java @@ -1,6 +1,7 @@ package com.bonus.material.back.service.impl; import java.math.BigDecimal; +import java.math.RoundingMode; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -17,15 +18,14 @@ import com.bonus.common.core.utils.DateUtils; import com.bonus.common.core.utils.StringUtils; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.security.utils.SecurityUtils; -import com.bonus.material.back.domain.BackApplyDetails; -import com.bonus.material.back.domain.MaCode; -import com.bonus.material.back.domain.MaCodeDto; +import com.bonus.material.back.domain.*; import com.bonus.material.back.domain.vo.*; import com.bonus.common.biz.domain.BmFileInfo; import com.bonus.material.basic.mapper.BmFileInfoMapper; import com.bonus.material.common.domain.dto.SelectDto; import com.bonus.material.common.domain.vo.AgreementVo; import com.bonus.material.common.mapper.SelectMapper; +import com.bonus.material.lease.domain.vo.LeaseTotalInfo; import com.bonus.material.ma.mapper.MachineMapper; import com.bonus.material.purchase.config.RemoteConfig; import com.bonus.material.settlement.domain.SltAgreementInfo; @@ -37,7 +37,6 @@ import com.bonus.material.task.mapper.TmTaskMapper; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import com.bonus.material.back.mapper.BackApplyInfoMapper; -import com.bonus.material.back.domain.BackApplyInfo; import com.bonus.material.back.service.IBackApplyInfoService; import org.springframework.transaction.annotation.Transactional; @@ -502,7 +501,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService { details.setMaId(maCodeDto.getMaId()); details.setPreNum(BigDecimal.valueOf(1)); details.setApDetection(maCodeDto.getApDetection()); - if ("1".equals(maCodeDto.getApDetection())) { + /*if ("1".equals(maCodeDto.getApDetection())) { details.setGoodNum(BigDecimal.valueOf(1)); } else { details.setGoodNum(BigDecimal.valueOf(0)); @@ -511,7 +510,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService { details.setBadNum(BigDecimal.valueOf(1)); } else { details.setBadNum(BigDecimal.valueOf(0)); - } + }*/ // 插入 CheckDetails result += backApplyInfoMapper.insertCheckDetails(details); if (CollectionUtils.isNotEmpty(maCodeDto.getBmFileInfos())) { @@ -700,8 +699,8 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService { if (dto == null) { return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "参数不能为空"); } - if (dto.getUnitId() == null) { - return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "单位ID为空"); + if (dto.getTeamId() == null) { + return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "班组ID为空"); } if (dto.getProId() == null) { return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "工程ID为空"); @@ -776,7 +775,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService { result += updateTaskAndBackInfo(backApplyInfo); if (result > 0 && CollectionUtils.isNotEmpty(applyInfoList)) { for (BackApplyInfo applyInfo : applyInfoList) { - result += machineMapper.updateStatus(applyInfo.getMaId(), MaMachineStatusEnum.BACK_REPAIR.getStatus()); + result += machineMapper.updateStatus(applyInfo.getMaId(), MaMachineStatusEnum.IN_STORE.getStatus()); } // 获取applyInfoList的typeId并生成集合 List typeIdList = applyInfoList.stream() @@ -1442,6 +1441,39 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService { return backApplyInfoMapper.getDetailsList(backApplyInfo); } + /** + * 工器具退料记录 + * @param info + * @return + */ + @Override + public List getBackInfoDetails(BackApplyTotalInfo info) { + BigDecimal backNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + List list = backApplyInfoMapper.getBackInfoDetails(info); + if (CollectionUtils.isNotEmpty(list)) { + for (BackApplyTotalInfo backApplyTotalInfo : list) { + backNum = backNum.add(backApplyTotalInfo.getBackNum()); + } + if (info.getIsExport() == 0) { + BackApplyTotalInfo info1 = new BackApplyTotalInfo(); + info1.setUnitName("合计"); + info1.setBackNum(backNum); + list.add(0, info1); + } + } + return list; + } + + /** + * 工器具退料二级页面记录 + * @param info + * @return + */ + @Override + public List getSecondBackInfo(BackApplyTotalInfo info) { + return backApplyInfoMapper.getSecondBackInfo(info); + } + /** * 总站点关键字搜索 * @param item diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/ComplexQueryController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/ComplexQueryController.java index ed6f8b7a..00eecbab 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/ComplexQueryController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/ComplexQueryController.java @@ -60,19 +60,7 @@ public class ComplexQueryController extends BaseController { List list = complexQueryService.getRetainedEquipmentList(bean); RetainedEquipmentInfo dto = new RetainedEquipmentInfo(); if (CollectionUtils.isNotEmpty(list)) { - RetainedEquipmentInfo retainedEquipmentInfo = list.get(0); - dto.setStoreNum(retainedEquipmentInfo.getStoreNum()); - dto.setUsNum(retainedEquipmentInfo.getUsNum()); - dto.setRepairNum(retainedEquipmentInfo.getRepairNum()); - dto.setInputNum(retainedEquipmentInfo.getInputNum()); - dto.setRepairInputNum(retainedEquipmentInfo.getRepairInputNum()); - dto.setPendingScrapNum(retainedEquipmentInfo.getPendingScrapNum()); - dto.setScrapNum(retainedEquipmentInfo.getScrapNum()); - dto.setAllNum(retainedEquipmentInfo.getAllNum()); - dto.setTotalPrice(retainedEquipmentInfo.getTotalPrice()); - dto.setFiveReplacementRate(retainedEquipmentInfo.getFiveReplacementRate()); - dto.setTenReplacementRate(retainedEquipmentInfo.getTenReplacementRate()); - dto.setTenPlusReplacementRate(retainedEquipmentInfo.getTenPlusReplacementRate()); + dto = list.get(0); } return AjaxResult.success(dto); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/StorageInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/StorageInfo.java index b57fad42..0c18b308 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/StorageInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/StorageInfo.java @@ -32,7 +32,6 @@ public class StorageInfo { private String typeModelName; @ApiModelProperty(value = "入库数量") - @Excel(name = "入库数量") private BigDecimal storeNum; @ApiModelProperty(value = "购置单价") @@ -44,7 +43,6 @@ public class StorageInfo { private String maCode; @ApiModelProperty(value = "库管员") - @Excel(name = "库管员") private String maKeeper; @ApiModelProperty(value = "操作人") @@ -58,7 +56,6 @@ public class StorageInfo { private Date inputTime; @ApiModelProperty(value = "入库方式") - @Excel(name = "入库方式") private String inputType; @ApiModelProperty(value = "关键字") diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/UseStorageInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/UseStorageInfo.java index 42fdf67e..478dcf19 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/UseStorageInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/UseStorageInfo.java @@ -34,20 +34,18 @@ public class UseStorageInfo { @Excel(name = "规格型号") private String typeModelName; - @ApiModelProperty(value = "在用数量") - @Excel(name = "在用数量") - private BigDecimal usNum; - @ApiModelProperty(value = "购置单价") @Excel(name = "原值(元)") private BigDecimal buyPrice; + @ApiModelProperty(value = "在用数量") + private BigDecimal usNum; + @ApiModelProperty(value = "设备编码") @Excel(name = "设备编码") private String maCode; @ApiModelProperty(value = "库管员") - @Excel(name = "库管员") private String maKeeper; @ApiModelProperty(value = "操作人") @@ -61,10 +59,10 @@ public class UseStorageInfo { private Date outTime; @ApiModelProperty(value = "领料单号") + @Excel(name = "领料单号") private String code; @ApiModelProperty(value = "工程名称") - @Excel(name = "工程名称") private String projectName; @ApiModelProperty(value = "关键字") diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/ComplexQueryServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/ComplexQueryServiceImpl.java index 0c5ec2d2..6ad736a2 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/ComplexQueryServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/ComplexQueryServiceImpl.java @@ -170,15 +170,7 @@ public class ComplexQueryServiceImpl implements ComplexQueryService { BigDecimal totalRepairNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); BigDecimal totalInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); BigDecimal totalRepairInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); - BigDecimal totalPendingScrapNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); - BigDecimal totalScrapNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); BigDecimal totalAllNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); - BigDecimal fiveReplacementNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); - BigDecimal tenReplacementNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); - BigDecimal tenPlusReplacementNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); - String fiveReplacementRate = "0%"; - String tenReplacementRate = "0%"; - String tenPlusReplacementRate = "0%"; List recordList = complexQueryMapper.getRetainedEquipmentList(bean); if (CollectionUtils.isNotEmpty(recordList)) { for (RetainedEquipmentInfo retainedEquipmentInfo : recordList) { @@ -187,57 +179,12 @@ public class ComplexQueryServiceImpl implements ComplexQueryService { totalRepairNum = totalRepairNum.add(retainedEquipmentInfo.getRepairNum()); totalInputNum = totalInputNum.add(retainedEquipmentInfo.getInputNum()); totalRepairInputNum = totalRepairInputNum.add(retainedEquipmentInfo.getRepairInputNum()); - totalPendingScrapNum = totalPendingScrapNum.add(retainedEquipmentInfo.getPendingScrapNum()); - totalScrapNum = totalScrapNum.add(retainedEquipmentInfo.getScrapNum()); totalAllNum = totalAllNum.add(retainedEquipmentInfo.getAllNum()); - fiveReplacementNum = fiveReplacementNum.add(retainedEquipmentInfo.getFiveReplacementNum()); - tenReplacementNum = tenReplacementNum.add(retainedEquipmentInfo.getTenReplacementNum()); - tenPlusReplacementNum = tenPlusReplacementNum.add(retainedEquipmentInfo.getTenPlusReplacementNum()); BigDecimal equipmentPrice = retainedEquipmentInfo.getAllNum() .multiply(retainedEquipmentInfo.getBuyPrice()) .divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP); totalPrice = totalPrice.add(equipmentPrice); - BigDecimal allNum = retainedEquipmentInfo.getAllNum(); - if (allNum.compareTo(BigDecimal.ZERO) == 0) { - fiveReplacementRate = "0%"; - tenReplacementRate = "0%"; - tenPlusReplacementRate = "0%"; - } else { - fiveReplacementRate = retainedEquipmentInfo.getFiveReplacementNum() - .divide(allNum, 4, RoundingMode.HALF_DOWN) - .multiply(new BigDecimal(100)) - .setScale(2, RoundingMode.HALF_UP) + "%"; - tenReplacementRate = retainedEquipmentInfo.getTenReplacementNum() - .divide(allNum, 4, RoundingMode.HALF_DOWN) - .multiply(new BigDecimal(100)) - .setScale(2, RoundingMode.HALF_UP) + "%"; - tenPlusReplacementRate = retainedEquipmentInfo.getTenPlusReplacementNum() - .divide(allNum, 4, RoundingMode.HALF_DOWN) - .multiply(new BigDecimal(100)) - .setScale(2, RoundingMode.HALF_UP) + "%"; - } retainedEquipmentInfo.setTotalPrice(equipmentPrice); - retainedEquipmentInfo.setFiveReplacementRate(fiveReplacementRate); - retainedEquipmentInfo.setTenReplacementRate(tenReplacementRate); - retainedEquipmentInfo.setTenPlusReplacementRate(tenPlusReplacementRate); - } - if (totalAllNum.compareTo(BigDecimal.ZERO) == 0) { - fiveReplacementRate = "0%"; - tenReplacementRate = "0%"; - tenPlusReplacementRate = "0%"; - } else { - fiveReplacementRate = fiveReplacementNum - .divide(totalAllNum, 4, RoundingMode.HALF_DOWN) - .multiply(new BigDecimal(100)) - .setScale(2, RoundingMode.HALF_UP) + "%"; - tenReplacementRate = tenReplacementNum - .divide(totalAllNum, 4, RoundingMode.HALF_DOWN) - .multiply(new BigDecimal(100)) - .setScale(2, RoundingMode.HALF_UP) + "%"; - tenPlusReplacementRate = tenPlusReplacementNum - .divide(totalAllNum, 4, RoundingMode.HALF_DOWN) - .multiply(new BigDecimal(100)) - .setScale(2, RoundingMode.HALF_UP) + "%"; } if (bean.getIsExport() == 0) { RetainedEquipmentInfo retainedEquipmentInfo = new RetainedEquipmentInfo(); @@ -246,13 +193,8 @@ public class ComplexQueryServiceImpl implements ComplexQueryService { retainedEquipmentInfo.setRepairNum(totalRepairNum); retainedEquipmentInfo.setInputNum(totalInputNum); retainedEquipmentInfo.setRepairInputNum(totalRepairInputNum); - retainedEquipmentInfo.setPendingScrapNum(totalPendingScrapNum); - retainedEquipmentInfo.setScrapNum(totalScrapNum); retainedEquipmentInfo.setAllNum(totalAllNum); retainedEquipmentInfo.setTotalPrice(totalPrice); - retainedEquipmentInfo.setFiveReplacementRate(fiveReplacementRate); - retainedEquipmentInfo.setTenReplacementRate(tenReplacementRate); - retainedEquipmentInfo.setTenPlusReplacementRate(tenPlusReplacementRate); retainedEquipmentInfo.setUnit("合计"); recordList.add(0, retainedEquipmentInfo); } @@ -354,11 +296,11 @@ public class ComplexQueryServiceImpl implements ComplexQueryService { public List getUserRecords(UseStorageInfo bean) { try { // 查询库管员 - UseStorageInfo info = complexQueryMapper.selectMaTypeName(bean); + //UseStorageInfo info = complexQueryMapper.selectMaTypeName(bean); List list = complexQueryMapper.getUserRecords(bean); if (CollectionUtils.isNotEmpty(list)) { for (UseStorageInfo useStorageInfo : list) { - useStorageInfo.setMaKeeper(info.getMaKeeper() == null ? "" : info.getMaKeeper()); + //useStorageInfo.setMaKeeper(info.getMaKeeper() == null ? "" : info.getMaKeeper()); // 查询出库信息 if (useStorageInfo.getLeaseId() != null) { UseStorageInfo dto = complexQueryMapper.selectInFo(useStorageInfo); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/domain/dto/SelectDto.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/domain/dto/SelectDto.java index 7f10b3fc..25a04f46 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/domain/dto/SelectDto.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/domain/dto/SelectDto.java @@ -33,6 +33,9 @@ public class SelectDto { /** 往来单位id*/ private int unitId; + /** 班组id*/ + private int teamId; + /** 标段工程id*/ private int projectId; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java index 512af818..42a573b4 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java @@ -414,7 +414,7 @@ public class SelectServiceImpl implements SelectService { return AjaxResult.error("未找到匹配的协议信息"); } } catch (Exception e) { - log.error("往来单位id和标段工程id获取协议信息", e); + log.error("班组id和标段工程id获取协议信息", e); } return AjaxResult.success(vo); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/config/MyBatisConfig.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/config/MyBatisConfig.java index 92189997..9200ac9e 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/config/MyBatisConfig.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/config/MyBatisConfig.java @@ -10,7 +10,7 @@ import org.springframework.context.annotation.Configuration; * mybatis 配置类 * @author weiweiwang */ -@Configuration +//@Configuration public class MyBatisConfig { @Bean public ConfigurationCustomizer configurationCustomizer() { diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Machine.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Machine.java index 3ebd521f..a1752e6e 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Machine.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Machine.java @@ -69,9 +69,7 @@ public class Machine extends BaseEntity /** 出厂日期 */ @ApiModelProperty(value = "出厂日期") - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "出厂日期", width = 30, dateFormat = "yyyy-MM-dd") - private Date outFacTime; + private String outFacTime; /** 出厂编号 */ @Excel(name = "出厂编号") @@ -90,15 +88,13 @@ public class Machine extends BaseEntity /** 本次检验日期 */ @ApiModelProperty(value = "本次检验日期") - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "本次检验日期", width = 30, dateFormat = "yyyy-MM-dd") - private Date thisCheckTime; + @Excel(name = "本次检验日期") + private String thisCheckTime; /** 下次检验日期 */ @ApiModelProperty(value = "下次检验日期") - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "下次检验日期", width = 30, dateFormat = "yyyy-MM-dd") - private Date nextCheckTime; + @Excel(name = "下次检验日期") + private String nextCheckTime; /** gps编号 */ @Excel(name = "gps编号") diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java index c4b626fb..ae9ad1f2 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java @@ -242,4 +242,6 @@ public class Type extends BaseEntity { @ApiModelProperty(value = "机具编码") private String maCode; + @ApiModelProperty(value = "领料人") + private String leasePerson; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java index ee9091fb..28e108c4 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java @@ -309,7 +309,19 @@ public class MachineServiceImpl implements IMachineService */ @Override public List getMachineInfo(Machine machine) { - return machineMapper.getMachineInfo(machine); + List machineInfo = machineMapper.getMachineInfo(machine); + if (CollectionUtils.isNotEmpty(machineInfo)) { + for (Machine dto : machineInfo) { + if ("1".equals(dto.getMaStatus())) { + dto.setMaStatus("在库"); + } else if ("2".equals(dto.getMaStatus())) { + dto.setMaStatus("在用"); + } else if ("3".equals(dto.getMaStatus())) { + dto.setMaStatus("退回"); + } + } + } + return machineInfo; } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warning/StatisticTask.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warning/StatisticTask.java index 3452a8f7..de531465 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warning/StatisticTask.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warning/StatisticTask.java @@ -1,6 +1,7 @@ package com.bonus.material.warning; import com.alibaba.nacos.common.utils.CollectionUtils; +import com.alibaba.nacos.common.utils.StringUtils; import com.bonus.common.core.utils.DateUtils; import com.bonus.common.security.utils.SecurityUtils; import com.bonus.material.ma.domain.Machine; @@ -35,10 +36,12 @@ public class StatisticTask { private MachineMapper machineMapper; /** - * 每日凌晨1点统计数据 + * 每日凌晨2点统计数据 */ - @Scheduled(cron = "0 30 0 * * ?") + @Scheduled(cron = "0 0 2 * * ?") + //@Scheduled(cron = "0 * * * * ?") public void setTypeInfoToMaType() { + System.err.println("-----------开始计算四类未结算费用定时器-----------"); // 首先查询当天ma_station_push表推送的数据 LocalDate today = LocalDate.now(); String formDate = today.format(DateTimeFormatter.ISO_LOCAL_DATE); @@ -138,19 +141,25 @@ public class StatisticTask { typeMapper.updateNum(existing); item.setTypeId(existing.getTypeId()); } else { + item.setCreateBy(SecurityUtils.getUserId().toString()); + item.setCreateTime(DateUtils.getNowDate()); int count = typeMapper.insertType(item); if (count <= 0) { throw new RuntimeException("Failed to insert level 4 item: " + item.getModelCode()); } } - Machine machine = new Machine(); - machine.setTypeId(item.getTypeId()); - machine.setMaCode(item.getMaCode()); - Machine existingMachine = machineMapper.getMachineById(machine); - if (existingMachine == null) { - // 推送过来的数据默认状态为 在库 - machine.setMaStatus("1"); - machineMapper.insertMachine(machine); + if (!"计数".equals(item.getMaCode()) && item.getTypeId() != null) { + Machine machine = new Machine(); + machine.setTypeId(item.getTypeId()); + machine.setMaCode(item.getMaCode()); + machine.setCreateBy(StringUtils.isNotBlank(item.getLeasePerson()) ? item.getLeasePerson() : SecurityUtils.getUserId().toString()); + machine.setCreateTime(DateUtils.getNowDate()); + Machine existingMachine = machineMapper.getMachineById(machine); + if (existingMachine == null) { + // 推送过来的数据默认状态为 在库 + machine.setMaStatus("1"); + machineMapper.insertMachine(machine); + } } } } diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml index 330f3375..e8c075ea 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml @@ -37,8 +37,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bp.pro_id as proId, bai.remark as remark, bp.pro_name as proName, - bu.unit_id as unitId, - bu.unit_name as unitName, + bt.id as teamId, + bt.team_name as teamName, bai.back_time as backTime, tt.task_status as taskStatus, bai.create_by as createBy, @@ -58,21 +58,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND bagi.`status` = '1' LEFT JOIN bm_project bp on bp.pro_id = bagi.project_id AND bp.del_flag = '0' - LEFT JOIN bm_unit bu on bu.unit_id = bagi.unit_id - AND bu.del_flag = '0' + LEFT JOIN bm_team bt on bt.id = bagi.team_id + AND bt.del_flag = '0' LEFT JOIN ma_type mt1 ON mt1.type_id = bad.type_id AND mt1.del_flag = '0' LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id AND mt2.del_flag = '0' WHERE 1=1 - - and bu.unit_id = #{unitId} + + and bt.id = #{teamId} and bp.pro_id = #{proId} - and tt.task_status = #{appTaskStatus} @@ -118,7 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id WHERE 1 = 1 and mm.ma_status = '2' and mm.type_id = #{typeId} - AND ba.unit_id = #{unitId} + AND ba.team_id = #{teamId} AND ba.project_id = #{proId} GROUP BY mm.ma_code @@ -138,8 +137,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bai.STATUS AS STATUS, bai.print_status AS printStatus, ba.agreement_id AS agreementId, - bu.unit_id AS unitId, - bu.unit_name AS unitName, + bt.id AS teamId, + bt.team_name AS teamName, bp.pro_id AS proId, bp.pro_name AS proName, bai.direct_audit_by AS directAuditBy @@ -148,8 +147,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN tm_task_agreement tta ON bai.task_id = tta.task_id LEFT JOIN bm_agreement_info ba ON ba.agreement_id = tta.agreement_id AND ba.`status` = 1 - LEFT JOIN bm_unit bu ON ba.unit_id = bu.unit_id - AND bu.del_flag = '0' + LEFT JOIN bm_team bt ON bt.id = ba.team_id + AND bt.del_flag = '0' LEFT JOIN bm_project bp ON ba.project_id = bp.pro_id AND bp.del_flag = '0' WHERE @@ -302,8 +301,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mm.type_id AS typeId, mt.type_name AS materialName, mt2.type_name AS materialType, - ba.unit_id AS unitId, - bu.unit_name AS unitName, + ba.team_id AS teamId, + bt.team_name AS teamName, ba.project_id AS proId, bp.pro_name AS proName, ba.agreement_id AS agreementId @@ -321,11 +320,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN bm_agreement_info ba ON tta.agreement_id = ba.agreement_id LEFT JOIN bm_project bp on bp.pro_id = ba.project_id AND bp.del_flag = '0' - LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id + LEFT JOIN bm_team bt on bt.team_id = ba.team_id AND bu.del_flag = '0' WHERE mm.ma_status = '2' and mm.ma_code = #{maCode} - AND ba.unit_id = #{unitId} + AND ba.team_id = #{teamId} AND ba.project_id = #{proId} @@ -394,8 +393,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mm.type_id AS typeId, mt.type_name AS typeModelName, mt2.type_name AS materialType, - ba.unit_id AS unitId, - bu.unit_name AS unitName, + ba.team_id AS teamId, + bt.team_name AS teamName, ba.project_id AS proId, bp.pro_name AS proName, ba.agreement_id AS agreementId @@ -413,8 +412,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN bm_agreement_info ba ON tta.agreement_id = ba.agreement_id LEFT JOIN bm_project bp on bp.pro_id = ba.project_id AND bp.del_flag = '0' - LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id - AND bu.del_flag = '0' + LEFT JOIN bm_team bt on bt.team_id = ba.team_id + AND bt.del_flag = '0' WHERE mm.ma_status = '2' and mm.qr_code = #{qrCode} @@ -950,6 +949,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" GROUP BY task_code + ORDER by + task_time + DESC + + + + diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml index 53d745bd..f4615d26 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml @@ -382,7 +382,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mt2.type_id AS thirdTypeId, mt.type_name AS typeModelName, mt.unit_name AS unit, - IFNULL(mt.buy_price, 0) AS buyPrice, + IFNULL(mt.lease_price, 0) AS buyPrice, CASE mt.manage_type WHEN 0 THEN IFNULL(subquery0.num, 0) @@ -393,25 +393,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" IFNULL(subquery2.repairNum, 0) AS repairNum, IFNULL(subquery3.repairInputNum, 0) AS repairInputNum, IFNULL(subquery4.inputNum, 0) AS inputNum, - IFNULL(subquery6.pendingScrapNum, 0) AS pendingScrapNum, - IFNULL(subquery6.scrapNum, 0) AS scrapNum, CASE mt.manage_type WHEN 0 THEN - IFNULL(subquery0.num, 0)+ IFNULL(subquery1.usNum, 0) + IFNULL(subquery2.repairNum, 0) + IFNULL(subquery3.repairInputNum, 0) - + IFNULL(subquery4.inputNum, 0) + IFNULL(subquery6.pendingScrapNum, 0) + IFNULL(subquery0.num, 0)+ IFNULL(subquery1.usNum, 0) ELSE - IFNULL(mt.storage_num, 0)+ IFNULL(subquery1.usNum, 0) + IFNULL(subquery2.repairNum, 0) + IFNULL(subquery3.repairInputNum, 0) - + IFNULL(subquery4.inputNum, 0) + IFNULL(subquery6.pendingScrapNum, 0) + IFNULL(mt.storage_num, 0)+ IFNULL(subquery1.usNum, 0) END AS allNum, CASE mt.manage_type WHEN 0 THEN '编码' ELSE '数量' - END manageType, - IFNULL(subquery5.fiveReplacementNum, 0) AS fiveReplacementNum, - IFNULL(subquery5.tenReplacementNum, 0) AS tenReplacementNum, - IFNULL(subquery5.tenPlusReplacementNum, 0) AS tenPlusReplacementNum + END manageType FROM ma_type mt LEFT JOIN ( SELECT @@ -545,36 +538,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and pcd.status in (3,4, 13,14) GROUP BY mt.type_id) AS subquery4 ON subquery4.type_id = mt.type_id - LEFT JOIN ( - SELECT - mt.type_id AS typeId, - IFNULL(SUM(IF(TIMESTAMPDIFF(YEAR,pcd.create_time,now()) < 5, pcd.input_num,0)),0) AS fiveReplacementNum, - IFNULL(SUM(IF(TIMESTAMPDIFF(YEAR,pcd.create_time,now()) >= 5 and TIMESTAMPDIFF(YEAR,pcd.create_time,now()) < 10, pcd.input_num,0)),0) AS tenReplacementNum, - IFNULL(SUM(IF(TIMESTAMPDIFF(YEAR,pcd.create_time,now()) >= 10, pcd.input_num,0)),0) AS tenPlusReplacementNum - FROM purchase_check_details pcd - LEFT JOIN ma_type mt ON pcd.type_id = mt.type_id - GROUP BY mt.type_id - ) subquery5 ON subquery5.typeId = mt.type_id - LEFT JOIN ( - SELECT - mt.type_id AS typeId, - mt4.type_name AS constructionType, - mt4.type_id AS firstTypeId, - mt3.type_name AS materialType, - mt3.type_id AS secondTypeId, - mt2.type_name AS typeName, - mt2.type_id AS thirdTypeId, - mt.type_name AS typeModelName, - SUM(IF(sad.status IN ('0','1'), IFNULL(sad.scrap_num, 0), 0)) AS pendingScrapNum, - SUM(IF(sad.ledger_status = '1', IFNULL(sad.scrap_num, 0), 0)) AS scrapNum - FROM scrap_apply_details sad - LEFT JOIN ma_type mt ON mt.type_id = sad.type_id - LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id - LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id - LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id - GROUP BY - mt.type_id - ) subquery6 ON subquery6.typeId = mt.type_id LEFT JOIN ma_type mt2 on mt2.type_id = mt.parent_id LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id @@ -606,48 +569,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml index 5e90401c..0fea64e0 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml @@ -37,9 +37,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" IFNULL(subquery0.num, 0) ELSE IFNULL(mt.storage_num, 0) - END as storageNum, + END as storage_num, mt.manage_type as manageType, - IFNULL(lad.pre_num,0) as preNum, + IFNULL(lad.pre_num,0) as pre_num, IFNULL(lad.audit_num,0) as audit_num, IFNULL(lad.al_num,0) as al_num, IFNULL(lad.status,0) as status, mt.unit_name as unitName,mt.unit_value, diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml index f5a58175..e02d7e09 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml @@ -326,6 +326,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" GROUP BY task_code + ORDER BY + task_time DESC