功能优化

This commit is contained in:
mashuai 2025-03-20 15:53:18 +08:00
parent 8b50866190
commit dc384cbdda
13 changed files with 91 additions and 10 deletions

View File

@ -178,7 +178,7 @@ public class LeaseOutDetailsController extends BaseController {
@Log(title = "领料出库(出库单)") @Log(title = "领料出库(出库单)")
@GetMapping("/getLeaseOutOrder") @GetMapping("/getLeaseOutOrder")
public AjaxResult getLeaseOutOrder(String parentId, String typeId) { public AjaxResult getLeaseOutOrder(String parentId, String typeId) {
if (StringUtils.isBlank(parentId) || StringUtils.isBlank(typeId)) { if (StringUtils.isBlank(parentId)) {
return AjaxResult.error("参数错误"); return AjaxResult.error("参数错误");
} else { } else {
return AjaxResult.success(leaseOutDetailsService.getLeaseOutOrder(parentId, typeId)); return AjaxResult.success(leaseOutDetailsService.getLeaseOutOrder(parentId, typeId));

View File

@ -39,4 +39,6 @@ public class LeaseOutDetailRecord {
// 出库方式 // 出库方式
private String manageTypeName; private String manageTypeName;
//计量单位
private String unitNames;
} }

View File

@ -340,5 +340,8 @@ public class TmTask implements Serializable {
@ApiModelProperty(value = "是否成套设备") @ApiModelProperty(value = "是否成套设备")
private Integer isCt; private Integer isCt;
@ApiModelProperty(value = "出库时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date outTime;
} }

View File

@ -1,7 +1,7 @@
package com.bonus.sgzb.app.service.impl; package com.bonus.sgzb.app.service.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson2.JSONObject; import cn.hutool.core.date.DateUtil;
import com.bonus.sgzb.app.domain.LeaseApplyDetails; import com.bonus.sgzb.app.domain.LeaseApplyDetails;
import com.bonus.sgzb.app.domain.LeaseOutDetailRecord; import com.bonus.sgzb.app.domain.LeaseOutDetailRecord;
import com.bonus.sgzb.app.domain.TmTask; import com.bonus.sgzb.app.domain.TmTask;
@ -14,15 +14,14 @@ import com.bonus.sgzb.base.mapper.MaMachineMapper;
import com.bonus.sgzb.base.service.ISysConfigService; import com.bonus.sgzb.base.service.ISysConfigService;
import com.bonus.sgzb.base.vo.MaLabelBindVO; import com.bonus.sgzb.base.vo.MaLabelBindVO;
import com.bonus.sgzb.common.core.constant.Constants; import com.bonus.sgzb.common.core.constant.Constants;
import com.bonus.sgzb.common.core.utils.HttpHelper;
import com.bonus.sgzb.common.core.utils.StringUtils; import com.bonus.sgzb.common.core.utils.StringUtils;
import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.security.utils.SecurityUtils; import com.bonus.sgzb.common.security.utils.SecurityUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -149,6 +148,13 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
public TmTask getLeaseOutOrder(String parentId, String typeId) { public TmTask getLeaseOutOrder(String parentId, String typeId) {
TmTask orderHead = leaseApplyDetailsMapper.getOrderHead(parentId); TmTask orderHead = leaseApplyDetailsMapper.getOrderHead(parentId);
List<LeaseOutDetailRecord> list = leaseApplyDetailsMapper.getOrderBody(parentId, typeId); List<LeaseOutDetailRecord> list = leaseApplyDetailsMapper.getOrderBody(parentId, typeId);
if (!CollectionUtils.isEmpty(list)) {
// 获取第一个创建时间
String createTime = list.get(0).getCreateTime();
// 将createTime转换为date类型保留年月日
Date date = DateUtil.parse(createTime, "yyyy-MM-dd");
orderHead.setOutTime(date);
}
orderHead.setLeaseOutDetailRecord(list); orderHead.setLeaseOutDetailRecord(list);
return orderHead; return orderHead;
} }
@ -280,7 +286,7 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
// 更新 (ma_machine 设备表)的状态 // 更新 (ma_machine 设备表)的状态
leaseOutDetailsMapper.updateMaMachineStatus(record); leaseOutDetailsMapper.updateMaMachineStatus(record);
//判断是数量设备还是编码设备 //判断是数量设备还是编码设备
if (record.getMaId()!=null){ /*if (record.getMaId()!=null){
//查询装备是否推送到租赁 //查询装备是否推送到租赁
MaMachine maMachine = maMachineMapper.selectMaMachineByMaId(Long.valueOf(record.getMaId())); MaMachine maMachine = maMachineMapper.selectMaMachineByMaId(Long.valueOf(record.getMaId()));
if (maMachine != null && maMachine.getPushStatus().equals(1)) { if (maMachine != null && maMachine.getPushStatus().equals(1)) {
@ -300,7 +306,7 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
throw new RuntimeException("同步租赁商城机具状态失败"); throw new RuntimeException("同步租赁商城机具状态失败");
} }
} }
} }*/
} }
} }
return res; return res;

View File

@ -55,6 +55,17 @@ public class SelectController {
return service.getMaTypeDataById(dto); return service.getMaTypeDataById(dto);
} }
/**
* 根据三级查四级在用下拉数据
* @param dto
* @return
*/
@ApiOperation(value = "机具在用数量下拉选")
@PostMapping("getFourMaTypeList")
public AjaxResult getFourMaTypeList(@RequestBody SelectDto dto){
return service.getFourMaTypeList(dto);
}
@ApiOperation(value = "数据字典下拉选") @ApiOperation(value = "数据字典下拉选")
@PostMapping("getDictByPidCbx") @PostMapping("getDictByPidCbx")
public AjaxResult getDictByPidCbx(@RequestBody SelectDto dto){ public AjaxResult getDictByPidCbx(@RequestBody SelectDto dto){

View File

@ -1,5 +1,6 @@
package com.bonus.sgzb.material.domain; package com.bonus.sgzb.material.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
/** /**
@ -29,4 +30,7 @@ public class SelectDto {
/** 标段工程id*/ /** 标段工程id*/
private int projectId; private int projectId;
@ApiModelProperty(value = "协议id")
private Integer agreementId;
} }

View File

@ -32,4 +32,6 @@ public class SelectVo {
private String isReplace; private String isReplace;
//0不是库存管理 1是库存管理 //0不是库存管理 1是库存管理
private String isStorage; private String isStorage;
private String parentId;
} }

View File

@ -204,4 +204,6 @@ public interface SelectMapper {
* @return * @return
*/ */
List<SelectVo> getMaTypeDataById(SelectDto dto); List<SelectVo> getMaTypeDataById(SelectDto dto);
List<SelectVo> getFourMaTypeList(SelectDto dto);
} }

View File

@ -189,4 +189,11 @@ public interface SelectService {
* @return * @return
*/ */
AjaxResult getMaTypeDataById(SelectDto dto); AjaxResult getMaTypeDataById(SelectDto dto);
/**
* 根据三级查四级在用下拉数据
* @param dto
* @return
*/
AjaxResult getFourMaTypeList(SelectDto dto);
} }

View File

@ -17,6 +17,7 @@ import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.stream.Collectors;
/** /**
* @author 10488 * @author 10488
@ -85,6 +86,23 @@ public class SelectServiceImpl implements SelectService {
return AjaxResult.success(list); return AjaxResult.success(list);
} }
/**
* 四级机具类型下拉选
* @param dto
* @return
*/
@Override
public AjaxResult getFourMaTypeList(SelectDto dto) {
List<SelectVo> list = mapper.getFourMaTypeList(dto);
if (CollectionUtils.isNotEmpty(list)) {
// 获取到 list parentId dto 相同的数据
list = list.stream()
.filter(item -> Objects.equals(item.getParentId(), dto.getId()))
.collect(Collectors.toList());
}
return AjaxResult.success(list);
}
@Override @Override
public AjaxResult getDictByPidCbx(SelectDto dto) { public AjaxResult getDictByPidCbx(SelectDto dto) {

View File

@ -84,7 +84,7 @@
tt.`code`, tt.`code`,
tt.update_time, tt.update_time,
mt.type_name typeModelName, mt.type_name typeModelName,
mt.unit_name, mt.unit_name unitNames,
case WHEN mt.manage_type = '0' then '编号' else '计数' end manageTypeName, case WHEN mt.manage_type = '0' then '编号' else '计数' end manageTypeName,
mt2.type_name typeName, mt2.type_name typeName,
lod.out_num, lod.out_num,
@ -102,7 +102,10 @@
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
LEFT JOIN ma_machine mm on lod.ma_id = mm.ma_id LEFT JOIN ma_machine mm on lod.ma_id = mm.ma_id
WHERE WHERE
lod.parent_id = #{parentId} and lod.type_id = #{typeId} lod.parent_id = #{parentId}
<if test="typeId != null and typeId != ''">
and lod.type_id = #{typeId}
</if>
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">

View File

@ -1066,7 +1066,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHEN bad.back_status = 3 THEN bad.scrap_remark END AS remark, WHEN bad.back_status = 3 THEN bad.scrap_remark END AS remark,
bad.scrap_reason, bad.scrap_reason,
bad.type_id as typeId, bad.type_id as typeId,
bad.back_num AS num bad.back_num AS num,
mm.ma_code AS maCode,
mt.unit_name AS unitNames
FROM FROM
back_check_details bad back_check_details bad
LEFT JOIN back_apply_info bai ON bai.id = bad.parent_id LEFT JOIN back_apply_info bai ON bai.id = bad.parent_id
@ -1080,6 +1082,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.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 LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
LEFT JOIN ma_machine mm ON bad.ma_id = mm.ma_id
WHERE WHERE
bai.task_id = #{taskId} bai.task_id = #{taskId}
<if test="companyId != null and companyId != ''"> <if test="companyId != null and companyId != ''">

View File

@ -256,5 +256,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from second_lot_config slc from second_lot_config slc
left join bm_unit_info bui on slc.unit_id = bui.unit_id left join bm_unit_info bui on slc.unit_id = bui.unit_id
</select> </select>
<select id="getFourMaTypeList" resultType="com.bonus.sgzb.material.domain.SelectVo">
SELECT
mt.type_id AS id,
mt.type_name AS name,
mt.parent_id AS parentId,
mt.unit_name AS unit,
SUM( CASE WHEN sai.agreement_id = #{agreementId} AND sai.STATUS = '0' THEN sai.num ELSE 0 END ) AS num,
mt.LEVEL,
mt.lease_price AS leasePrice,
mt.is_storage AS isStorage,
mt.is_replace AS isReplace
FROM
ma_type mt
LEFT JOIN slt_agreement_info sai ON mt.type_id = sai.type_id
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(sai2.lease_type,0) = 0 and sai2.num > 0)
GROUP BY
mt.type_id
</select>
</mapper> </mapper>