电子档案

liweidong
maxiangong 3 days ago
parent bb4425c45d
commit e55a244443
  1. 6
      blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/quality/pojo/entity/AuditFile.java
  2. 8
      blade-service/blade-desk/src/main/java/org/springblade/desk/produce/mapper/WorkPlanMapper.xml
  3. 6
      blade-service/blade-desk/src/main/java/org/springblade/desk/quality/mapper/AuditFileMapper.java
  4. 31
      blade-service/blade-desk/src/main/java/org/springblade/desk/quality/mapper/AuditFileMapper.xml
  5. 59
      blade-service/blade-desk/src/main/java/org/springblade/desk/quality/service/impl/InspectionTaskServiceImpl.java

@ -116,4 +116,10 @@ public class AuditFile extends BaseEntity {
@Schema(description = "产品应用领域")
@JsonSerialize(using = Integer0ToEmptyStringSerializer.class)
private Integer prodApplyArea;
/**
* 工艺能力ID
*/
@Schema(description = "工艺能力ID")
private Long caId;
}

@ -79,8 +79,8 @@
</select>
<select id="listSlotInfoGr" resultType="org.springblade.desk.produce.pojo.vo.ProduceMonitorSlotListVO">
select a.PART_CODE, a.BATCH_NO, a.WORK_QTY, a.area, a.sumArea,
a.MTN_CODE, a.prod_ident,a.wo_code,a.material,a.yield_type from (
select a.PART_CODE as partCode, a.BATCH_NO as batchNo, a.WORK_QTY as workQty, a.area, a.sumArea,
a.MTN_CODE as mtnCode, a.prod_ident as prodIdent,a.wo_code as woCode,a.material,a.yield_type as yieldType from (
select d.PART_CODE, c.BATCH_NO, b.WORK_QTY, b.WORK_QTY*d.YP_AREA as area,
sum(b.WORK_QTY*d.YP_AREA) over() as sumArea,a.MTN_CODE, d.PRODUCT_IDENT as prod_ident,c.wo_code,f.material,d.yield_type
from MES_MAC_TOOL_USE a
@ -104,8 +104,8 @@
<select id="listSlotInfoList" resultType="org.springblade.desk.produce.pojo.vo.ProduceMonitorSlotListVO">
select a.PART_CODE, a.BATCH_NO, a.WORK_QTY, a.area, a.sumArea,
a.MTN_CODE, a.prod_ident,a.wo_code,a.material,a.yield_type from (
select a.PART_CODE as partCode, a.BATCH_NO as batchNo, a.WORK_QTY as workQty, a.area, a.sumArea,
a.MTN_CODE as mtnCode, a.prod_ident as prodIdent,a.wo_code as woCode,a.material,a.yield_type as yieldType from (
select d.PART_CODE, c.BATCH_NO, b.WORK_QTY, b.WORK_QTY*d.YP_AREA as area,
sum(b.WORK_QTY*d.YP_AREA) over() as sumArea, a.MTN_CODE, d.PRODUCT_IDENT as prod_ident,c.wo_code,f.material,d.yield_type
from MES_MAC_TOOL_USE a

@ -40,4 +40,10 @@ public interface AuditFileMapper extends BaseMapper<AuditFile> {
List<AuditFileExcel> exportAuditFile(@Param("ew") Wrapper<AuditFile> queryWrapper);
List<AuditFile> listSearch(IPage page, @Param("q") AuditFileSearch search);
AuditFile getByPpsId(Long ppsId);
AuditFile getDataByPpsIdAndApplyArea(@Param("ppsId") Long ppsId, @Param("wcId") Long wcId, @Param("prodApplyArea") String prodApplyArea, @Param("prodIdent") String prodIdent, @Param("caId") Long caId);
AuditFile getDataByPpsIdAndPqName(@Param("ppsId") Long ppsId, @Param("wcId") Long wcId, @Param("prodIdent") String prodIdent, @Param("caId") Long caId);
}

@ -15,6 +15,7 @@
<result column="SORT" property="sort"/>
<result column="REMARK" property="remark"/>
<result column="PROD_APPLY_AREA" property="prodApplyArea"/>
<result column="CA_ID" property="caId"/>
</resultMap>
<select id="selectAuditFilePage" resultMap="auditFileResultMap">
@ -66,4 +67,34 @@
AND u.REAL_NAME LIKE '%' || #{q.keepUserRealName} || '%'
</if>
</select>
<select id="getByPpsId" resultMap="auditFileResultMap">
select * from QA_AUDIT_FILE
where IS_DELETED = 0 and PPS_ID = #{ppsId}
</select>
<select id="getDataByPpsIdAndApplyArea" resultMap="auditFileResultMap">
select a.*
from QA_AUDIT_FILE a
INNER JOIN BS_PROD_MARK b ON a.PQ_ID = b.ID
where a.IS_DELETED = 0
and a.PPS_ID = #{ppsId}
and a.WC_ID = #{wcId}
and a.PROD_APPLY_AREA = #{prodApplyArea}
and b.NAME = #{prodIdent}
and a.CA_ID = #{caId}
</select>
<select id="getDataByPpsIdAndPqName" resultMap="auditFileResultMap">
select a.*
from QA_AUDIT_FILE a
INNER JOIN BS_PROD_MARK b ON a.PQ_ID = b.ID
where a.IS_DELETED = 0
and a.PPS_ID = #{ppsId}
and a.WC_ID = #{wcId}
and b.NAME = #{prodIdent}
and a.CA_ID = #{caId}
</select>
</mapper>

@ -28,8 +28,10 @@ import org.springblade.desk.basic.constant.BaseValue;
import org.springblade.desk.basic.mapper.OemMapper;
import org.springblade.desk.basic.pojo.entity.CenterTeam;
import org.springblade.desk.basic.pojo.entity.Oem;
import org.springblade.desk.basic.pojo.entity.TeamSet;
import org.springblade.desk.basic.service.ICenterTeamService;
import org.springblade.desk.basic.service.IPlatingService;
import org.springblade.desk.basic.service.ITeamSetService;
import org.springblade.desk.basic.util.IdUtil;
import org.springblade.desk.basic.util.StatusCountMap;
import org.springblade.desk.dashboard.pojo.entity.*;
@ -57,6 +59,7 @@ import org.springblade.desk.quality.constant.InspectionItemConst;
import org.springblade.desk.quality.constant.InspectionTaskConst;
import org.springblade.desk.quality.constant.ReviewSheetConst;
import org.springblade.desk.quality.excel.InspectionTaskExcel;
import org.springblade.desk.quality.mapper.AuditFileMapper;
import org.springblade.desk.quality.mapper.InspectionTaskMapper;
import org.springblade.desk.quality.pojo.entity.*;
import org.springblade.desk.quality.pojo.request.InspectionTaskSearch;
@ -147,6 +150,10 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
private IWorkPlanItemService workPlanItemService;
@Resource
private IMakeRecService makeRecService;
@Resource
private AuditFileMapper auditFileMapper;
@Resource
private ITeamSetService teamSetService;
@Override
@ -659,14 +666,14 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
}
// 检验记录
if (moduleList.get(1)) {
// if (moduleList.get(1)) {
JSONObject modelJson1 = new JSONObject();
List<JSONObject> checkList = this.getCheckListNotNG(woId, wpList, true);
modelJson1.put("checkList", checkList);
jsonObj.put("modelThree", modelJson1);
}
// }
List<JSONObject> modelTwoList = this.buildModelTwo(wpList, planList);
List<JSONObject> modelTwoList = this.buildModelTwo(wo, yo, dsPart, wpList, planList);
jsonObj.put("modelTwo", modelTwoList);
if (moduleList.get(2)) {
@ -682,6 +689,7 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
/**
* 构建modelOne
*
* @param wo
* @param yo
* @param dsPart
@ -692,7 +700,7 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
JSONObject yoJson = new JSONObject();
JSONObject partJson = new JSONObject();
JSONObject modelJson = new JSONObject();
if(dsPart != null){
if (dsPart != null) {
partJson.put("partCode", dsPart.getPartCode());
partJson.put("partName", dsPart.getPartName());
partJson.put("hardness", dsPart.getHardness());
@ -701,14 +709,14 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
partJson.put("cruxMemo", dsPart.getKeyInfo());
partJson.put("memo", dsPart.getRemarks());
}
if(yo != null){
if (yo != null) {
yoJson.put("productType", yo.getProductType());
yoJson.put("prodIdent", yo.getProductIdent());
yoJson.put("poQty", yo.getYpQty());
yoJson.put("poArea", yo.getYpArea());
yoJson.put("primaryCraft", yo.getPrimaryCraft());
}
if(wo != null){
if (wo != null) {
woJson.put("batchNo", wo.getBatchNo());
}
woJson.put("pjYieldOrder", yoJson);
@ -719,11 +727,12 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
/**
* 构建modelTwo
*
* @param wpList
* @param modelFlag
* @return
*/
private List<JSONObject> buildModelTwo(List<WorkPlanExpandVO> wpList, List<Boolean> modelFlag) {
private List<JSONObject> buildModelTwo(WorkOrder wo, YieldOrder yo, DsPartEntity dsPart, List<WorkPlanExpandVO> wpList, List<Boolean> modelFlag) {
if (wpList == null || wpList.size() == 0) {
return null;
}
@ -740,9 +749,9 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
tankInfo.put("pdjArea", null);
tankInfo.put("gjArea", null);
modelTwo.put("orders", prWorkPlan.getOrders());
modelTwo.put("papers", prWorkPlan.getPapers());
modelTwo.put("createMan", prWorkPlan.getCreateMan());
modelTwo.put("factEndTime", prWorkPlan.getFactEndTime());
modelTwo.put("papers", prWorkPlan.getPapers());
modelTwo.put("referenceFile", prWorkPlan.getReferenceFile());
modelTwo.put("procedureSet", procedureSet);
modelTwo.put("slotList", slotList);
@ -763,13 +772,13 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
if (CollectionUtils.isNotEmpty(slotVOList)) {
for (ProduceMonitorSlotListVO slot : slotVOList) {
JSONObject slotJson = new JSONObject();
slotJson.put("mtuCode", slot.getMtuCode());
slotJson.put("mtuCode", slot.getMtnCode());
slotJson.put("partCode", slot.getPartCode());
slotJson.put("batchNo", slot.getBatchNo());
slotJson.put("workQty", slot.getWorkQty());
slotJson.put("prodIdent", slot.getProdIdent());
slotJson.put("area", slot.getArea());
slotJson.put("totalArea", slot.getTotalArea());
slotJson.put("totalArea", slot.getSumArea());
slotList.add(slotJson);
}
}
@ -827,6 +836,33 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
modelTwo.put("workerImgUrl", checkManByNewErpMes);
}
}
if (StringUtils.isEmpty(prWorkPlan.getPapers()) || StringUtils.isEmpty(prWorkPlan.getReferenceFile())) {
AuditFile auditFile = null;
if ("涂色标".equals(prWorkPlan.getPpsName()) || "喷砂".equals(prWorkPlan.getPpsName())) {
auditFile = auditFileMapper.getByPpsId(prWorkPlan.getPpsId());
} else {
if (wo.getTsId() != null) {
TeamSet teamSet = teamSetService.getById(wo.getTsId());
String productApplicationArea = null;
if (teamSet != null) {
if (dsPart != null) {
productApplicationArea = dsPart.getProductApplicationArea();
}
String productIdent = yo.getProductIdent();
if (StringUtils.isNotEmpty(productApplicationArea) && StringUtils.isNotEmpty(productIdent)) {
auditFile = auditFileMapper.getDataByPpsIdAndApplyArea(prWorkPlan.getPpsId(), teamSet.getWcId(), productApplicationArea, productIdent, prWorkPlan.getCaId());
}
if (StringUtils.isNotEmpty(productIdent) && auditFile == null) {
auditFile = auditFileMapper.getDataByPpsIdAndPqName(prWorkPlan.getPpsId(), teamSet.getWcId(), productIdent, prWorkPlan.getCaId());
}
}
}
}
if (auditFile != null) {
modelTwo.put("papers", auditFile.getPapers());
modelTwo.put("referenceFile", auditFile.getReferenceFile());
}
}
modelTwoList.add(modelTwo);
}
}
@ -835,10 +871,11 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap
/**
* 构建dsRbFilePreserveSlotList
*
* @param workPlan
* @return
*/
private List<MesRbFilePreserveSlotEntity> buildDsRbFilePreserveSlotList(WorkPlanExpandVO workPlan){
private List<MesRbFilePreserveSlotEntity> buildDsRbFilePreserveSlotList(WorkPlanExpandVO workPlan) {
List<MesRbFilePreserveSlotEntity> dsRbFilePreserveSlotList = new ArrayList<>();
QueryWrapper<CenterTeam> qwteam = new QueryWrapper<>();
qwteam.eq("TS_ID", workPlan.getMakeTeam());

Loading…
Cancel
Save