This commit is contained in:
mashuai 2025-10-23 18:51:55 +08:00
parent a1a2bc44ad
commit 8904b1efc5
14 changed files with 92 additions and 80 deletions

View File

@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import java.math.BigDecimal;
import java.util.Date;
@ -103,7 +104,7 @@ public class LeaseApplyInfoExport extends BaseEntity{
* 预领料合计数
*/
@ApiModelProperty(value = "预领料合计数")
@Excel(name = "申请数量")
@Excel(name = "申请数量", cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT)
private BigDecimal preCountNum;
/** 领料人 */

View File

@ -179,4 +179,7 @@ public class LeaseOutDetails extends BaseEntity {
@ApiModelProperty(value = "唯一任务id")
private String keyId;
@ApiModelProperty(value = "老规格型号id")
private Long oldTypeId;
}

View File

@ -33,22 +33,22 @@ public class ProjUsingRecord {
private Integer proId;
@ApiModelProperty(value = "工程名称")
@Excel(name = "工程名称")
@Excel(name = "工程名称", width = 30)
private String proName;
@ApiModelProperty(value = "往来单位Id")
private Integer unitId;
@ApiModelProperty(value = "往来单位")
@Excel(name = "往来单位")
@Excel(name = "往来单位", width = 30)
private String unitName;
@ApiModelProperty(value = "实施单位")
@Excel(name = "实施单位")
@Excel(name = "实施单位", width = 30)
private String impUnitName;
@ApiModelProperty(value = "合同主体")
@Excel(name = "合同主体")
//@Excel(name = "合同主体")
private String contractPart;
@ApiModelProperty(value = "物资名称")
@ -86,7 +86,7 @@ public class ProjUsingRecord {
private BigDecimal usPrice;
@ApiModelProperty(value = "投入总价值(元)")
@Excel(name = "投入总价值(元)", align = HorizontalAlignment.RIGHT, cellType = Excel.ColumnType.NUMERIC)
//@Excel(name = "投入总价值(元)", align = HorizontalAlignment.RIGHT, cellType = Excel.ColumnType.NUMERIC)
private BigDecimal totalPrice;
@ApiModelProperty(value = "关键字")

View File

@ -32,7 +32,7 @@ public class RetainedEquipmentInfo {
private Integer id;
@ApiModelProperty(value = "仓库信息")
@Excel(name = "仓库信息")
//@Excel(name = "仓库信息")
private String whHouseName;
@ApiModelProperty(value = "施工类型")
@ -66,8 +66,8 @@ public class RetainedEquipmentInfo {
@Excel(name = "在用数量", align = HorizontalAlignment.RIGHT, cellType = Excel.ColumnType.NUMERIC)
private BigDecimal usNum;
@ApiModelProperty(value = "定损数量")
@Excel(name = "定损数量", align = HorizontalAlignment.RIGHT, cellType = Excel.ColumnType.NUMERIC)
@ApiModelProperty(value = "待修数量")
@Excel(name = "待修数量", align = HorizontalAlignment.RIGHT, cellType = Excel.ColumnType.NUMERIC)
private BigDecimal dsNum;
@ApiModelProperty(value = "在修数量")
@ -91,7 +91,7 @@ public class RetainedEquipmentInfo {
private BigDecimal pendingScrapNum;
@ApiModelProperty(value = "已审核报废数量")
@Excel(name = "已审核报废数量", align = HorizontalAlignment.RIGHT, cellType = Excel.ColumnType.NUMERIC)
//@Excel(name = "已审核报废数量", align = HorizontalAlignment.RIGHT, cellType = Excel.ColumnType.NUMERIC)
private BigDecimal scrapNum;
@ApiModelProperty(value = "总保有量")

View File

@ -49,17 +49,17 @@ public class StorageInfo {
private String maKeeper;
@ApiModelProperty(value = "操作人")
@Excel(name = "操作人")
//@Excel(name = "操作人")
private String inputUser;
@ApiModelProperty(value = "创建时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
//@Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date inputTime;
@ApiModelProperty(value = "入库方式")
@Excel(name = "入库方式")
//@Excel(name = "入库方式")
private String inputType;
@ApiModelProperty(value = "关键字")

View File

@ -4,6 +4,7 @@ import com.bonus.common.core.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import java.math.BigDecimal;
import java.util.Date;
@ -38,52 +39,52 @@ public class PurChaseReportInfo {
private String unitName;
@ApiModelProperty(value = "采购数量")
@Excel(name = "采购数量")
@Excel(name = "采购数量", cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT)
private BigDecimal purchaseNum;
@ApiModelProperty(value = "验收合格数量")
@Excel(name = "验收合格数量")
@Excel(name = "验收合格数量", cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT)
private BigDecimal passNum;
@ApiModelProperty(value = "入库数量")
@Excel(name = "入库数量")
@Excel(name = "入库数量", cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT)
private BigDecimal inputNum;
@ApiModelProperty(value = "待入库数量")
@Excel(name = "待入库数量", cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT)
private BigDecimal pendingInputNum;
@ApiModelProperty(value = "采购价格含税")
@Excel(name = "采购价格(含税)")
@Excel(name = "采购价格(含税)", cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT)
private BigDecimal purchasePrice;
@ApiModelProperty(value = "采购价格不含税")
@Excel(name = "采购价格(不含税)")
@Excel(name = "采购价格(不含税)", cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT)
private BigDecimal purchasePriceNoTax;
@ApiModelProperty(value = "物资厂家")
@Excel(name = "物资厂家")
@Excel(name = "物资厂家", width = 30)
private String supplierName;
@ApiModelProperty(value = "采购时间")
@ApiModelProperty(value = "到货时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Excel(name = "采购时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "到货时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date purchaseTime;
@ApiModelProperty(value = "验收时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Excel(name = "验收时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "验收时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date passTime;
@ApiModelProperty(value = "入库时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "入库时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date inputTime;
@ApiModelProperty(value = "入库人员")
@Excel(name = "入库人员")
private String inputUser;
@ApiModelProperty(value = "待入库数量")
@Excel(name = "待入库数量")
private BigDecimal pendingInputNum;
@ApiModelProperty(value = "入库单号")
@Excel(name = "入库单号")
private String inputCode;

View File

@ -195,8 +195,8 @@ public class ComplexQueryServiceImpl implements ComplexQueryService {
BigDecimal totalRepairAuditNum = 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 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);
@ -214,8 +214,8 @@ public class ComplexQueryServiceImpl implements ComplexQueryService {
totalRepairAuditNum = totalRepairAuditNum.add(retainedEquipmentInfo.getRepairAuditNum());
totalInputNum = totalInputNum.add(retainedEquipmentInfo.getInputNum());
totalRepairInputNum = totalRepairInputNum.add(retainedEquipmentInfo.getRepairInputNum());
totalPendingScrapNum = totalPendingScrapNum.add(retainedEquipmentInfo.getPendingScrapNum());
totalScrapNum = totalScrapNum.add(retainedEquipmentInfo.getScrapNum());
/*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());
@ -224,8 +224,8 @@ public class ComplexQueryServiceImpl implements ComplexQueryService {
.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) {
/*BigDecimal allNum = retainedEquipmentInfo.getAllNum();
if (allNum.compareTo(BigDecimal.ZERO) == 0) {
fiveReplacementRate = "0%";
tenReplacementRate = "0%";
tenPlusReplacementRate = "0%";
@ -275,8 +275,8 @@ public class ComplexQueryServiceImpl implements ComplexQueryService {
retainedEquipmentInfo.setRepairAuditNum(totalRepairAuditNum);
retainedEquipmentInfo.setInputNum(totalInputNum);
retainedEquipmentInfo.setRepairInputNum(totalRepairInputNum);
retainedEquipmentInfo.setPendingScrapNum(totalPendingScrapNum);
retainedEquipmentInfo.setScrapNum(totalScrapNum);
/*retainedEquipmentInfo.setPendingScrapNum(totalPendingScrapNum);
retainedEquipmentInfo.setScrapNum(totalScrapNum);*/
retainedEquipmentInfo.setAllNum(totalAllNum);
retainedEquipmentInfo.setTotalPrice(totalPrice);
/*retainedEquipmentInfo.setFiveReplacementRate(fiveReplacementRate);
@ -297,8 +297,8 @@ public class ComplexQueryServiceImpl implements ComplexQueryService {
*/
@Override
public List<StorageInfo> getMaCodeList(StorageInfo bean) {
List<StorageInfo> recordList = complexQueryMapper.getMaCodeList(bean);
List<StorageInfo> list = new ArrayList<>();
List<StorageInfo> list = complexQueryMapper.getMaCodeList(bean);
/*List<StorageInfo> list = new ArrayList<>();
if (CollectionUtils.isNotEmpty(recordList)) {
for (StorageInfo storageInfo : recordList) {
if (StringUtils.isNotBlank(storageInfo.getMaCode())) {
@ -332,7 +332,7 @@ public class ComplexQueryServiceImpl implements ComplexQueryService {
list = list.stream()
.filter(item -> validCodes.contains(item.getTypeId() + "-" + item.getMaCode()))
.collect(Collectors.toList());
}
}*/
if (StringUtils.isNotBlank(bean.getKeyWord())) {
String keyword = bean.getKeyWord();
return list.stream().filter(item -> {

View File

@ -55,6 +55,9 @@ public class LeaseApplyDetails extends BaseEntity {
@ApiModelProperty(value = "规格型号id")
private Long newTypeId;
@ApiModelProperty(value = "老规格型号id")
private Long oldTypeId;
@ApiModelProperty(value = "三级id")
private Long thirdTypeId;

View File

@ -10,6 +10,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
@ -33,7 +34,7 @@ public class PurchaseCheckInfo extends BaseEntity {
@ApiModelProperty(value = "任务ID")
private Long taskId;
@Excel(name = "任务状态", readConverterExp = "21=入库进行中,22=入库已完成", sort = 10)
//@Excel(name = "任务状态", readConverterExp = "21=入库进行中,22=入库已完成", sort = 10)
@ApiModelProperty(value = "任务状态")
private Integer taskStatus;
@ -53,7 +54,7 @@ public class PurchaseCheckInfo extends BaseEntity {
@ApiModelProperty(value = "到货日期")
@NotNull(message = "到货日期不能为空")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Excel(name = "到货日期", width = 15, dateFormat = "yyyy-MM-dd", sort = 1)
@Excel(name = "到货时间", width = 15, dateFormat = "yyyy-MM-dd", sort = 1)
private Date arrivalTime;
/** 采购员 */
@ -67,7 +68,7 @@ public class PurchaseCheckInfo extends BaseEntity {
private Long supplierId;
/** 物资厂家名称 */
@Excel(name = "物资厂家名称", sort = 8)
@Excel(name = "物资厂家名称", sort = 8, width = 30)
@ApiModelProperty(value = "物资厂家名称")
private String supplier;
@ -85,7 +86,7 @@ public class PurchaseCheckInfo extends BaseEntity {
/**
* 采购数量
*/
@Excel(name = "采购数量", sort = 4)
@Excel(name = "采购数量", sort = 4, cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT)
@ApiModelProperty(value = "采购数量--外层Table字段")
private BigDecimal purchaseMaNumber;
@ -110,21 +111,21 @@ public class PurchaseCheckInfo extends BaseEntity {
/**
* 采购单价(不含税)
*/
@Excel(name = "采购价(不含税)", sort = 5)
@Excel(name = "采购(不含税)", sort = 6, cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT)
@ApiModelProperty(value = "采购单价(不含税)--外层Table字段")
private BigDecimal purchasePrice;
/**
* 采购单价(含税)
*/
@Excel(name = "采购价(含税)", sort = 6)
@Excel(name = "采购(含税)", sort = 5, cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT)
@ApiModelProperty(value = "采购单价(含税)--外层Table字段")
private BigDecimal purchaseTaxPrice;
/**
* 税率
*/
@Excel(name = "税率", sort = 7)
@Excel(name = "税率", sort = 7, cellType = Excel.ColumnType.NUMERIC, align = HorizontalAlignment.RIGHT)
@ApiModelProperty(value = "税率 0~100")
@Size(max = 100, message = "税率长度必须介于 0 和 100 之间")
private BigDecimal taxRate;

View File

@ -119,7 +119,10 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
List<ScrapApplyDetails> list = scrapApplyDetailsMapper.selectRepairQuestListByTaskId(scrapApplyDetails);
if (CollectionUtils.isNotEmpty(list)) {
for (ScrapApplyDetails applyDetails : list) {
BigDecimal totalCost = applyDetails.getScrapNum().multiply(applyDetails.getBuyPrice());
BigDecimal totalCost = BigDecimal.ZERO;
if (applyDetails.getBuyPrice() != null) {
totalCost = applyDetails.getScrapNum().multiply(applyDetails.getBuyPrice());
}
applyDetails.setTotalCost(totalCost);
BmFileInfo bmFileInfo = new BmFileInfo();
bmFileInfo.setModelId(applyDetails.getRepairId());

View File

@ -161,7 +161,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN purchase_check_details pcd ON bqi.task_id = pcd.task_id
AND pcd.type_id = bqi.type_id
WHERE
bqi.task_id = 1149 and bqi.type_id = 517 and mm.ma_status = 0
bqi.task_id = #{taskId} and bqi.type_id = #{typeId} and mm.ma_status = 0
<if test="keyWord != null and keyWord != ''">
AND (
mt2.type_name LIKE CONCAT('%', #{keyWord}, '%')
@ -186,7 +186,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN purchase_check_details pcd ON bqi.task_id = pcd.task_id
AND pcd.type_id = bqi.type_id
WHERE
bqi.task_id = 1149 and bqi.type_id = 517 and bqi.ma_code is null
bqi.task_id = #{taskId} and bqi.type_id = #{typeId} and bqi.ma_code is null
<if test="keyWord != null and keyWord != ''">
AND (
mt2.type_name LIKE CONCAT('%', #{keyWord}, '%')

View File

@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
) mtm ON mt3.parent_id = mtm.type_id
WHERE
1=1
sai.is_slt = '0'
<if test="externalId != null and externalId != '' ">
and bp.external_id = #{externalId}
</if>
@ -320,15 +320,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
IFNULL(subquery12.repairAuditNum, 0) AS repairAuditNum,
IFNULL(subquery3.repairInputNum, 0) AS repairInputNum,
IFNULL(subquery4.inputNum, 0) AS inputNum,
IFNULL(subquery6.pendingScrapNum, 0) AS pendingScrapNum,
IFNULL(subquery6.scrapNum, 0) AS scrapNum,
/*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.dsNum, 0) + IFNULL(subquery2.repairNum, 0) + IFNULL(subquery3.repairInputNum, 0)
+ IFNULL(subquery12.repairAuditNum, 0) + IFNULL(subquery4.inputNum, 0)
+ IFNULL(subquery12.repairAuditNum, 0)
ELSE
IFNULL(mt.storage_num, 0)+ IFNULL(subquery1.usNum, 0) + IFNULL(subquery2.dsNum, 0) + IFNULL(subquery2.repairNum, 0) + IFNULL(subquery3.repairInputNum, 0)
+ IFNULL(subquery12.repairAuditNum, 0) + IFNULL(subquery4.inputNum, 0)
+ IFNULL(subquery12.repairAuditNum, 0)
END AS allNum,
CASE mt.manage_type
WHEN 0 THEN
@ -393,7 +393,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt2.type_name AS typeName,
mt2.type_id AS thirdTypeId,
mt.type_name AS typeModelName,
SUM(CASE WHEN tt.task_status = 0 and rad.is_ds = 1 THEN IFNULL(rad.repair_num, 0) ELSE 0 END) AS dsNum,
SUM(CASE WHEN tt.task_status = 0 and rad.is_ds = 1 THEN (IFNULL(rad.repair_num, 0) - IFNULL(rad.repaired_num, 0) - IFNULL(rad.scrap_num, 0)) ELSE 0 END) AS dsNum,
SUM(CASE WHEN tt.task_status = 4 and rad.is_ds = 0 THEN (IFNULL(rad.repair_num, 0) - IFNULL(rad.repaired_num, 0) - IFNULL(rad.scrap_num, 0)) ELSE 0 END) AS repairNum
FROM repair_apply_details rad
LEFT JOIN ma_type mt ON mt.type_id = rad.type_id
@ -481,7 +481,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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 (
/*LEFT JOIN (
SELECT
mt.type_id AS typeId,
mt4.type_name AS constructionType,
@ -500,12 +500,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
GROUP BY
mt.type_id
) subquery6 ON subquery6.typeId = 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
LEFT JOIN ma_type_manage mtm ON mt4.type_id = mtm.type_id
WHERE mt.del_flag = '0'
and mt.is_show = '1'
<if test="userId != null">
and mtm.user_id = #{userId}
</if>
@ -533,6 +534,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeModelName != null and typeModelName != ''">
and mt.type_name like concat('%',#{typeModelName},'%')
</if>
HAVING allNum > 0
</select>
<select id="getStatisticsList" resultType="com.bonus.material.basic.domain.ProjUsingRecord">
SELECT
@ -822,36 +824,27 @@ 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,
mm.ma_code as maCode,
1 as storeNum,
mt.buy_price as buyPrice,
GROUP_CONCAT( DISTINCT su.nick_name ORDER BY su.nick_name SEPARATOR ', ' ) AS maKeeper
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 ma_type_keeper mtk ON mtk.type_id = mm.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
mm.ma_status = '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
GROUP BY mm.ma_id
</select>
<select id="getUserRecords" resultType="com.bonus.material.basic.domain.UseStorageInfo">

View File

@ -554,7 +554,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
END as storageNum,
mt4.type_id as firstId,
su.sign_url as signUrl,
su.sign_type as signType
su.sign_type as signType,
lpd.type_id as oldTypeId
FROM
lease_publish_details lpd
LEFT JOIN ma_type mt ON lpd.new_type = mt.type_id
@ -682,7 +683,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
lease_apply_details
WHERE
parent_id = #{record.parentId}
AND new_type = #{record.typeId}
AND type_id = #{record.oldTypeId}
</select>
<select id="getPendingLeaseApplyDetails" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
SELECT
@ -734,7 +735,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
lease_apply_details
WHERE
parent_id = #{parentId}
AND new_type = #{typeId}
AND type_id = #{oldTypeId}
</select>
<select id="getLeaseMaCode" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">

View File

@ -38,7 +38,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
tt.`code` AS scrapCode, tt2.`code` as repairCode ,tt.task_status AS taskStatus,tt.task_type as taskType,tt.company_id AS companyId,tt.remark,
bui.unit_name AS backUnit,
bpi.pro_name AS backPro,
sad.create_by AS createName,
tta.agreement_id as agreementId,
GROUP_CONCAT(DISTINCT mt2.type_name) as type,
CASE tt.task_status
@ -48,7 +47,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
else '未知'
END as taskStatusName,
su1.nick_name as auditByName,
sad.audit_time as auditTime
sad.audit_time as auditTime,
CASE
WHEN sad.create_by IS NOT NULL
AND CHAR_LENGTH(sad.create_by) * 3 = LENGTH(sad.create_by)
THEN sad.create_by -- 视为纯汉字取sad.create_by
ELSE COALESCE(su.nick_name, '未知创建人') -- 否则取su.nick_name
END AS createName
FROM
scrap_apply_details sad
LEFT JOIN ma_type mt on sad.type_id = mt.type_id
@ -61,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sys_user su1 on sad.audit_by = su1.user_id
left join repair_audit_details rad ON sad.parent_id = rad.id
left join tm_task tt2 ON tt2.task_id = rad.task_id
LEFT JOIN sys_user su ON su.user_name = sad.create_by
where
sad.scrap_source = '2'
<if test="typeId != null "> and type_id = #{typeId}</if>