This commit is contained in:
hongchao 2025-09-24 17:54:48 +08:00
commit 44fc28a2e3
9 changed files with 49 additions and 12 deletions

View File

@ -140,7 +140,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
// 设置制单人签名url
if (StringUtils.isNotBlank(backApplyInfo.getSignUrl())) {
if (!backApplyInfo.getSignUrl().startsWith("http")) {
backApplyInfo.setSignUrl("data:image/png;base64," + backApplyInfo.getBackSignUrl());
backApplyInfo.setSignUrl("data:image/png;base64," + backApplyInfo.getSignUrl());
}
}

View File

@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;
@ -94,6 +95,23 @@ public class MaterialMachineController extends BaseController {
@PostMapping("/exportRetainedEquipmentList")
public void exportRetainedEquipmentList(HttpServletResponse response, MaterialRetainedEquipmentInfo bean) {
List<MaterialRetainedEquipmentInfo> list = materialMachineService.getRetainedEquipmentList(bean);
if (list.size()>0){
for (MaterialRetainedEquipmentInfo item : list) {
// 根据 unitValue 决定 allNumStr 的格式
if (item.getAllNum() != null) {
if ("1".equals(item.getUnitValue())) {
// 显示小数例如保留2位
item.setAllNumStr(item.getAllNum().setScale(3, BigDecimal.ROUND_HALF_UP).toString());
} else {
// 不显示小数转为整数
item.setAllNumStr(item.getAllNum().setScale(0, BigDecimal.ROUND_HALF_UP).toString());
}
} else {
// 处理 null 情况
item.setAllNumStr("");
}
}
}
ExcelUtil<MaterialRetainedEquipmentInfo> util = new ExcelUtil<>(MaterialRetainedEquipmentInfo.class);
util.exportExcel(response, list, "综合查询--保有设备总量查询");
}

View File

@ -84,9 +84,11 @@ public class MaterialRetainedEquipmentInfo {
private BigDecimal usNum;
@ApiModelProperty(value = "数量")
@Excel(name = "数量",align = HorizontalAlignment.RIGHT)
private BigDecimal allNum;
@Excel(name = "数量",align = HorizontalAlignment.RIGHT)
private String allNumStr;
@ApiModelProperty(value = "购置单价")
private BigDecimal buyPrice;

View File

@ -992,7 +992,14 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
* @return
*/
private int updateSlt4Bean(MaterialBackApplyInfo record, List<MaterialBackApplyInfo> allList) {
//先根据外层id查询上层信息
MaterialBackApplyInfo backApplyInfo = materialBackInfoMapper.selectBackApplyInfoById(record.getId());
//根据退料任务查询班组id和工程id然后查询协议集合
MaterialBackApplyInfo agreement = materialBackInfoMapper.getAgreementInfo(backApplyInfo);
List<String> list = materialBackInfoMapper.getAgreementList(agreement);
for (MaterialBackApplyInfo bean : allList) {
bean.setAgreementIds(list);
List<SltAgreementInfo> infoList = materialBackInfoMapper.getStlInfo(bean);
if (infoList.size() > 0) {
BigDecimal backNum = bean.getBackNum();

View File

@ -123,9 +123,10 @@ public interface LeaseApplyInfoMapper {
/**
* 查询领料单的领料单出库签名
* @param id
* @param publishTask
* @return
*/
List<LeaseOutSign> selectLeaseApplyOutList(Long id);
List<LeaseOutSign> selectLeaseApplyOutList(@Param("id") Long id, @Param("publishTask") String publishTask);
/**
* 修改领用发布签名
@ -174,7 +175,7 @@ public interface LeaseApplyInfoMapper {
* @param id
* @return
*/
List<LeaseOutSign> selectOutList(@Param("id") Long id, @Param("leaseSignId") String leaseSignId);
List<LeaseOutSign> selectOutList(@Param("id") Long id, @Param("leaseSignId") String leaseSignId, @Param("publishTask") String publishTask);
/**
* 查询领用单的领用单出库签名

View File

@ -286,7 +286,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
}
// 步骤11: 查询出库库管员电子签名详情
long step11Start = System.currentTimeMillis();
List<LeaseOutSign> outSignList = leaseApplyInfoMapper.selectLeaseApplyOutList(id);
List<LeaseOutSign> outSignList = leaseApplyInfoMapper.selectLeaseApplyOutList(id, publishTask);
if (!CollectionUtils.isEmpty(outSignList)) {
for (LeaseOutSign applyInfo : outSignList) {
if (StringUtils.isNotBlank(applyInfo.getOutSignUrl())) {
@ -301,7 +301,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
// 步骤12: 查询领料人电子签名详情
long step12Start = System.currentTimeMillis();
List<LeaseOutSign> signList = leaseApplyInfoMapper.selectOutList(id, null);
List<LeaseOutSign> signList = leaseApplyInfoMapper.selectOutList(id, null, publishTask);
if (!CollectionUtils.isEmpty(signList)) {
for (LeaseOutSign applyInfo : signList) {
if (StringUtils.isNotBlank(applyInfo.getOutSignUrl())) {
@ -531,7 +531,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
}
// 步骤11: 查询出库库管员电子签名详情
long step11Start = System.currentTimeMillis();
List<LeaseOutSign> outSignList = leaseApplyInfoMapper.selectLeaseApplyOutList(id);
List<LeaseOutSign> outSignList = leaseApplyInfoMapper.selectLeaseApplyOutList(id, publishTask);
if (!CollectionUtils.isEmpty(outSignList)) {
for (LeaseOutSign applyInfo : outSignList) {
if (StringUtils.isNotBlank(applyInfo.getOutSignUrl())) {
@ -546,7 +546,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
// 步骤12: 查询领料人电子签名详情
long step12Start = System.currentTimeMillis();
List<LeaseOutSign> signList = leaseApplyInfoMapper.selectOutList(id, null);
List<LeaseOutSign> signList = leaseApplyInfoMapper.selectOutList(id, null, publishTask);
if (!CollectionUtils.isEmpty(signList)) {
for (LeaseOutSign applyInfo : signList) {
if (StringUtils.isNotBlank(applyInfo.getOutSignUrl())) {
@ -654,7 +654,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
}
// 根据id查询领料出库情况查询出库人电子签名详情
List<LeaseOutSign> outSignList = leaseApplyInfoMapper.selectLeaseApplyOutList(bean.getId());
List<LeaseOutSign> outSignList = leaseApplyInfoMapper.selectLeaseApplyOutList(bean.getId(), bean.getPublishTask());
if (!CollectionUtils.isEmpty(outSignList)) {
for (LeaseOutSign applyInfo : outSignList) {
if (StringUtils.isNotBlank(applyInfo.getOutSignUrl())) {
@ -680,7 +680,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
}
// 根据id查询领料出库情况查询出库人电子签名详情
List<LeaseOutSign> signList = leaseApplyInfoMapper.selectOutList(bean.getId(), bean.getLeaseSignId());
List<LeaseOutSign> signList = leaseApplyInfoMapper.selectOutList(bean.getId(), bean.getLeaseSignId(), bean.getPublishTask());
if (!CollectionUtils.isEmpty(signList)) {
for (LeaseOutSign applyInfo : signList) {
if (StringUtils.isNotBlank(applyInfo.getOutSignUrl())) {

View File

@ -251,5 +251,7 @@ public class SltAgreementInfo extends BaseEntity {
private String repairCode;
private String unitValue;
}

View File

@ -396,6 +396,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN lease_out_details lod ON su.user_id = lod.create_by
WHERE
lod.parent_id = #{id} AND su.sign_url IS NOT NULL
<if test="publishTask != null and publishTask != ''">
AND lod.publish_task = #{publishTask}
</if>
GROUP BY
su.user_id
</select>
@ -623,6 +626,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="leaseSignId != null">
and lsi.id = #{leaseSignId}
</if>
<if test="publishTask != null and publishTask != ''">
and lod.publish_task = #{publishTask}
</if>
GROUP BY
lod.lease_sign_id
</select>
@ -666,7 +672,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.`code` AS CODE,
lai.create_by AS createBy,
lai.create_time AS createTime,
lai.lease_person AS leasePerson,
a.lease_person AS leasePerson,
lai.phone AS phone,
a.unit_id AS leaseUnitId,
a.project_id AS leaseProjectId,
@ -686,7 +692,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
lease_out_details lod
LEFT JOIN lease_apply_info lai ON lai.id = lod.parent_id
LEFT JOIN tm_task tt ON lai.task_id = tt.task_id
LEFT JOIN (SELECT parent_id, unit_id,project_id,create_time,`code`,publish_task from lease_publish_details
LEFT JOIN (SELECT parent_id, unit_id,project_id,create_time,`code`,publish_task,lease_person from lease_publish_details
GROUP BY parent_id,publish_task) a ON a.parent_id = lod.parent_id
and a.publish_task = lod.publish_task
LEFT JOIN bm_unit bu ON bu.unit_id = a.unit_id

View File

@ -64,6 +64,7 @@
sai.ma_id as maId,
sai.type_id as typeId,
lai.create_time as createTime,
mt.unit_value as unitValue,
sai.*
FROM
slt_agreement_info sai