退料联调

This commit is contained in:
mashuai 2025-05-15 18:10:33 +08:00
parent b17992f822
commit 44ee2888e1
26 changed files with 578 additions and 222 deletions

View File

@ -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<BackApplyTotalInfo> 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<BackApplyTotalInfo> 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<BackApplyTotalInfo> list = backApplyInfoService.getBackInfoDetails(bean);
ExcelUtil<BackApplyTotalInfo> util = new ExcelUtil<>(BackApplyTotalInfo.class);
util.exportExcel(response, list, "综合查询--工器具退料记录查询");
}
/**
* 工器具退料二级页面记录
* @param info
* @return
*/
@ApiOperation(value = "工器具退料二级页面记录")
@GetMapping("/getSecondBackInfo")
public AjaxResult getSecondBackInfo(BackApplyTotalInfo info){
startPage();
List<BackMaCodeVo> list = backApplyInfoService.getSecondBackInfo(info);
return AjaxResult.success(getDataTable(list));
}
/**
* 导出工器具退料二级页面查询
* @param response
* @param bean
*/
@ApiOperation("导出工器具退料二级页面查询")
@PostMapping("/exportSecondBackInfo")
public void exportSecondBackInfo(HttpServletResponse response, BackApplyTotalInfo bean)
{
List<BackMaCodeVo> list = backApplyInfoService.getSecondBackInfo(bean);
ExcelUtil<BackMaCodeVo> util = new ExcelUtil<>(BackMaCodeVo.class);
util.exportExcel(response, list, "综合查询--工器具退料二级页面查询");
}
}

View File

@ -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 = "计量单位")

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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<BackApplyInfo> getDetailsList(BackApplyInfo backApplyInfo);
/**
* 工器具退料记录
* @param info
* @return
*/
List<BackApplyTotalInfo> getBackInfoDetails(BackApplyTotalInfo info);
/**
* 工器具退料二级页面记录
* @param info
* @return
*/
List<BackMaCodeVo> getSecondBackInfo(BackApplyTotalInfo info);
}

View File

@ -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<BackApplyInfo> getDetailsList(BackApplyInfo backApplyInfo);
/**
* 工器具退料记录
* @param info
* @return
*/
List<BackApplyTotalInfo> getBackInfoDetails(BackApplyTotalInfo info);
/**
* 工器具退料二级页面记录
* @param info
* @return
*/
List<BackMaCodeVo> getSecondBackInfo(BackApplyTotalInfo info);
}

View File

@ -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<String> typeIdList = applyInfoList.stream()
@ -1442,6 +1441,39 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
return backApplyInfoMapper.getDetailsList(backApplyInfo);
}
/**
* 工器具退料记录
* @param info
* @return
*/
@Override
public List<BackApplyTotalInfo> getBackInfoDetails(BackApplyTotalInfo info) {
BigDecimal backNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
List<BackApplyTotalInfo> 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<BackMaCodeVo> getSecondBackInfo(BackApplyTotalInfo info) {
return backApplyInfoMapper.getSecondBackInfo(info);
}
/**
* 总站点关键字搜索
* @param item

View File

@ -60,19 +60,7 @@ public class ComplexQueryController extends BaseController {
List<RetainedEquipmentInfo> 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);
}

View File

@ -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 = "关键字")

View File

@ -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 = "关键字")

View File

@ -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<RetainedEquipmentInfo> 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<UseStorageInfo> getUserRecords(UseStorageInfo bean) {
try {
// 查询库管员
UseStorageInfo info = complexQueryMapper.selectMaTypeName(bean);
//UseStorageInfo info = complexQueryMapper.selectMaTypeName(bean);
List<UseStorageInfo> 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);

View File

@ -33,6 +33,9 @@ public class SelectDto {
/** 往来单位id*/
private int unitId;
/** 班组id*/
private int teamId;
/** 标段工程id*/
private int projectId;

View File

@ -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);
}

View File

@ -10,7 +10,7 @@ import org.springframework.context.annotation.Configuration;
* mybatis 配置类
* @author weiweiwang
*/
@Configuration
//@Configuration
public class MyBatisConfig {
@Bean
public ConfigurationCustomizer configurationCustomizer() {

View File

@ -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编号")

View File

@ -242,4 +242,6 @@ public class Type extends BaseEntity {
@ApiModelProperty(value = "机具编码")
private String maCode;
@ApiModelProperty(value = "领料人")
private String leasePerson;
}

View File

@ -309,7 +309,19 @@ public class MachineServiceImpl implements IMachineService
*/
@Override
public List<Machine> getMachineInfo(Machine machine) {
return machineMapper.getMachineInfo(machine);
List<Machine> 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;
}
}

View File

@ -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);
}
}
}
}

View File

@ -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
<if test="unitId != null">
and bu.unit_id = #{unitId}
<if test="teamId != null">
and bt.id = #{teamId}
</if>
<if test="proId != null">
and bp.pro_id = #{proId}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
<![CDATA[and DATE_FORMAT( bai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
</if>
<if test="appTaskStatus != null and appTaskStatus == 0">
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
</select>
@ -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}
</select>
@ -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}
</select>
@ -950,6 +949,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
GROUP BY
task_code
ORDER by
task_time
DESC
</select>
<select id="getDetailsList" resultType="com.bonus.material.back.domain.BackApplyInfo">
@ -964,4 +966,90 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
task_code = #{code}
</select>
<select id="getBackInfoDetails" resultType="com.bonus.material.back.domain.BackApplyTotalInfo">
SELECT
bcd.id AS id,
bcd.parent_id AS parentId,
mt.type_id AS typeId,
mt2.type_name AS materialName,
mt.type_name AS typeName,
mt.manage_type AS manageType,
mt.unit_name AS unitName,
SUM( bcd.back_num ) AS backNum,
bcd.create_time AS backTime,
bt.team_name AS teamName,
bp.pro_name AS proName,
bai.back_person AS backPerson,
bai.create_by AS createBy,
bai.`code` AS code
FROM
back_check_details bcd
LEFT JOIN ma_type mt ON bcd.type_id = mt.type_id
AND mt.`level` = '4' AND mt.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
AND mt2.`level` = '3' AND mt2.del_flag = '0'
LEFT JOIN back_apply_info bai ON bcd.parent_id = bai.id
LEFT JOIN tm_task tt ON tt.task_id = bai.task_id
LEFT JOIN tm_task_agreement tta ON tta.task_id = tt.task_id
LEFT JOIN bm_agreement_info bagi ON bagi.agreement_id = tta.agreement_id
AND bagi.`status` = '1'
LEFT JOIN bm_project bp ON bp.pro_id = bagi.project_id
AND bp.del_flag = '0'
LEFT JOIN bm_team bt ON bt.id = bagi.team_id
AND bt.del_flag = '0'
WHERE
1 = 1
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
<![CDATA[and DATE_FORMAT( bcd.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
</if>
<if test="keyWord != null and keyWord != ''">
and (
mt2.type_name like concat('%', #{keyWord}, '%') or
mt.type_name like concat('%', #{keyWord}, '%') or
bt.team_name like concat('%', #{keyWord}, '%') or
bp.pro_name like concat('%', #{keyWord}, '%') or
bai.back_person like concat('%', #{keyWord}, '%') or
bai.create_by like concat('%', #{keyWord}, '%') or
bai.`code` like concat('%', #{keyWord}, '%')
)
</if>
GROUP BY
mt.type_id,
bt.id,
bp.pro_id,
bai.`code`
</select>
<select id="getSecondBackInfo" resultType="com.bonus.material.back.domain.vo.BackMaCodeVo">
SELECT
mt.type_id as typeId,
mt1.type_name as materialName,
mt.type_name as typeName,
mm.ma_id as maId,
mm.ma_code as maCode,
bai.back_person as backPerson,
bcd.create_time as backTime
FROM
back_check_details bcd
LEFT JOIN ma_machine mm ON bcd.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 back_apply_info bai ON bcd.parent_id = bai.id
WHERE
bcd.parent_id = #{parentId}
and mt.type_id = #{typeId}
<if test="keyWord != null and keyWord != ''">
AND (
mt1.type_name LIKE CONCAT(CONCAT('%', #{keyWord}), '%')
OR mt.type_name LIKE CONCAT(CONCAT('%', #{keyWord}), '%')
OR mm.ma_code LIKE CONCAT(CONCAT('%', #{keyWord}), '%')
OR bai.back_person LIKE CONCAT(CONCAT('%', #{keyWord}), '%')
)
</if>
ORDER BY
bcd.create_time DESC
</select>
</mapper>

View File

@ -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()) &lt; 5, pcd.input_num,0)),0) AS fiveReplacementNum,
IFNULL(SUM(IF(TIMESTAMPDIFF(YEAR,pcd.create_time,now()) &gt;= 5 and TIMESTAMPDIFF(YEAR,pcd.create_time,now()) &lt; 10, pcd.input_num,0)),0) AS tenReplacementNum,
IFNULL(SUM(IF(TIMESTAMPDIFF(YEAR,pcd.create_time,now()) &gt;= 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"
<select id="getMaCodeList" resultType="com.bonus.material.basic.domain.StorageInfo">
SELECT
bs.type_id as typeId,
mm.type_id as typeId,
mt1.type_name as typeName,
mt.type_name as typeModelName,
bs.ma_code as maCode,
bs.in_num as storeNum,
bs.creator as inputUser,
bs.create_time as inputTime,
CASE
WHEN tt.`code` LIKE 'XG%' THEN '新购入库'
WHEN tt.`code` LIKE 'R%' THEN '修饰入库'
WHEN tt.`code` LIKE 'PD%' THEN '盘点入库'
ELSE '未知入库类型'
END AS inputType,
mt.buy_price as buyPrice,
GROUP_CONCAT( DISTINCT su.nick_name ORDER BY su.nick_name SEPARATOR ', ' ) AS maKeeper
mm.ma_code as maCode,
mt.lease_price as buyPrice,
mm.create_by as inputUser,
mm.create_time as inputTime
FROM
bm_storage_log bs
LEFT JOIN ma_type mt ON bs.type_id = mt.type_id
ma_machine mm
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 tm_task tt ON bs.task_id = tt.task_id
LEFT JOIN ma_type_keeper mtk ON mtk.type_id = bs.type_id
LEFT JOIN sys_user su ON mtk.user_id = su.user_id
WHERE bs.in_num != 0 and (bs.result_msg = '操作成功' OR bs.result_msg = '入库成功')
WHERE
1 = 1
<if test="typeId != null">
AND bs.type_id = #{typeId}
AND mm.type_id = #{typeId}
</if>
GROUP BY bs.ma_code, mt.type_id, mt1.type_name, mt.type_name, bs.ma_code,
bs.in_num, bs.creator, bs.create_time, tt.CODE, mt.buy_price
<if test="keyWord != null and keyWord != ''">
AND (
mm.ma_code like concat('%',#{keyWord},'%') or
mt.type_name like concat('%',#{keyWord},'%') or
mt1.type_name like concat('%',#{keyWord},'%') or
mm.create_by like concat('%',#{keyWord},'%')
)
</if>
GROUP BY mm.ma_code, mm.type_id, mt1.type_name, mt.type_name
</select>
<select id="getUserRecords" resultType="com.bonus.material.basic.domain.UseStorageInfo">
SELECT
mt2.type_name AS typeName,
mt.type_name AS typeModelName,
mt.buy_price AS buyPrice,
mt.lease_price AS buyPrice,
sai.num AS usNum,
mm.ma_code AS maCode,
bp.pro_name AS projectName,
sai.lease_id AS leaseId,
sai.type_id AS typeId
sai.type_id AS typeId,
lai.code AS code
FROM
slt_agreement_info sai
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
@ -655,6 +616,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_machine mm ON mm.ma_id = sai.ma_id
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = sai.agreement_id
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
LEFT JOIN lease_apply_info lai ON lai.id = sai.lease_id
WHERE
sai.end_time IS NULL
AND sai.back_id IS NULL

View File

@ -173,13 +173,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE del_flag = '0' AND status = '0'
</select>
<!--往来单位id和标段工程id获取协议信息-->
<!--班组id和标段工程id获取协议信息-->
<select id="getAgreementInfoById" resultType="com.bonus.material.common.domain.vo.AgreementVo">
SELECT agreement_id AS agreementId,
agreement_code AS agreementCode,
is_slt AS isSlt
FROM bm_agreement_info
WHERE unit_id = #{unitId} AND project_id = #{projectId} AND status = '1'
WHERE team_id = #{teamId} AND project_id = #{projectId} AND status = '1'
</select>
<select id="getUseTypeTreeL4" resultType="com.bonus.common.biz.domain.TypeTreeNode">
@ -199,7 +199,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id and mt1.del_flag = '0'
WHERE
EXISTS ( SELECT 1 FROM slt_agreement_info sai2 WHERE sai2.type_id = mt.type_id AND sai2.agreement_id = #{agreementId}
AND sai2.STATUS = '0' and IFNULL(sai.lease_type,0) = 0 and sai2.num > 0)
AND sai2.STATUS = '0' and sai2.num > 0)
GROUP BY
mt.type_id
</select>

View File

@ -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,

View File

@ -326,6 +326,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
GROUP BY
task_code
ORDER BY
task_time DESC
</select>
<select id="getDetailsList" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo">

View File

@ -250,6 +250,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inspectStatus != null">inspect_status,</if>
<if test="phone != null">phone,</if>
<if test="inputTime != null">input_time,</if>
<if test="createBy != null">create_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="typeId != null">#{typeId},</if>
@ -279,6 +280,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inspectStatus != null">#{inspectStatus},</if>
<if test="phone != null">#{phone},</if>
<if test="inputTime != null">#{inputTime},</if>
<if test="createBy != null">#{createBy},</if>
</trim>
</insert>
@ -512,7 +514,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and (
ma_code like concat('%', #{keyWord}, '%') or
ma_qrcode like concat('%', #{keyWord}, '%') or
check_man like concat('%', #{keyWord}, '%')
check_man like concat('%', #{keyWord}, '%') or
ma_material like concat('%', #{keyWord}, '%') or
ma_type like concat('%', #{keyWord}, '%') or
ma_name like concat('%', #{keyWord}, '%') or
ma_model like concat('%', #{keyWord}, '%')
)
</if>
<if test="typeCode != null and typeCode != ''">

View File

@ -957,7 +957,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
COALESCE(t1.lease_price, t2.lease_price) AS leasePrice,
COALESCE(t1.push_time, t2.push_time) AS pushTime,
COALESCE(t1.manage_type, t2.manage_type) AS manageType,
COALESCE(t1.ma_code, t2.ma_code) AS maCode
COALESCE(t1.ma_code, t2.ma_code) AS maCode,
t1.lease_person AS leasePerson,
t1.ma_unit AS unitName
FROM (
SELECT
ma_material,
@ -968,7 +970,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SUM(num) AS sum_num_1,
lease_price,
push_time,
manage_type
manage_type,
lease_person,
ma_unit
FROM ma_station_push
WHERE task_type = '1'
<if test="pushTime != null">