Browse Source

opt:晶棒库库存页面新增 工单、出库状态字段;mes下发入库、工单判断是否存在,已存在更新,不存在新增

master
zds 2 months ago
parent
commit
bb8b5f4b98
  1. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java
  2. 54
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java
  3. 94
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/dao/mapper/ReportMapper.xml
  4. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/dto/YlDto.java
  5. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/impl/ReportServiceImpl.java
  6. 34
      lms/nladmin-ui/src/views/wms/ycl/detail/index.vue

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java

@ -236,7 +236,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String taskId = param.getString("taskId"); String taskId = param.getString("taskId");
BaseResponse result = BaseResponse.build(requestNo); BaseResponse result = BaseResponse.build(requestNo);
try { try {
SchBaseTask schBaseTask=taskService.getById(taskId); SchBaseTask schBaseTask = taskService.getById(taskId);
if(ObjectUtil.isEmpty(schBaseTask)){ if(ObjectUtil.isEmpty(schBaseTask)){
throw new BadRequestException("任务不存在!taskId:"+taskId); throw new BadRequestException("任务不存在!taskId:"+taskId);
} }

54
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java

@ -7,6 +7,8 @@ import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -15,6 +17,7 @@ import org.nl.wms.mes.domain.*;
import org.nl.wms.pdm.service.IPdmBdWorkorderService; import org.nl.wms.pdm.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
import org.nl.wms.pdm.service.dao.PdmBdWorkorderDetail; import org.nl.wms.pdm.service.dao.PdmBdWorkorderDetail;
import org.nl.wms.sch.material.service.IMaterialService;
import org.nl.wms.sch.material.service.dao.Material; import org.nl.wms.sch.material.service.dao.Material;
import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper; import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper;
import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum;
@ -46,6 +49,9 @@ public class MesController {
@Autowired @Autowired
private MaterialMapper materialMapper; private MaterialMapper materialMapper;
@Autowired
private IMaterialService materialService;
@Autowired @Autowired
private IPdmBdWorkorderService pdmBdWorkorderService; private IPdmBdWorkorderService pdmBdWorkorderService;
@ -74,13 +80,32 @@ public class MesController {
head.setSRC_SYSTEM("AGV"); head.setSRC_SYSTEM("AGV");
qpmes060Response.setHEAD(head); qpmes060Response.setHEAD(head);
try { try {
Material material = new Material();
for(QPMES060RequestBody QPMES060RequestBody:notice.toJavaObject(QPMES060Request.class).getBODY()) { for(QPMES060RequestBody QPMES060RequestBody:notice.toJavaObject(QPMES060Request.class).getBODY()) {
Material material = new Material();
//实体类
material.copyFrom(QPMES060RequestBody); material.copyFrom(QPMES060RequestBody);
material.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); String lotSN = material.getLotSN();
material.setReturn_status("0"); if(ObjectUtil.isNotEmpty(lotSN)){
material.setCreate_time(DateUtil.now()); Material entity = materialService.getOne(new LambdaQueryWrapper<Material>()
materialMapper.insert(material); .eq(Material::getLotSN, lotSN));
if (ObjectUtil.isEmpty(entity)){
//新增
material.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue());
material.setReturn_status("0");
material.setCreate_time(DateUtil.now());
materialMapper.insert(material);
}else{
LambdaUpdateWrapper<Material> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(Material::getLotSN,lotSN);
//更新
material.setGroup_bind_material_status(entity.getGroup_bind_material_status());
material.setReturn_status(entity.getReturn_status());
material.setCreate_time(DateUtil.now());
materialService.update(material,updateWrapper);
}
}else{
log.error("原材料入库晶棒号为空,{}", material.toString());
}
} }
qpmes060ResponseBody.setMESSAGE("原材料入库成功"); qpmes060ResponseBody.setMESSAGE("原材料入库成功");
qpmes060ResponseBody.setSTATUS("S"); qpmes060ResponseBody.setSTATUS("S");
@ -214,7 +239,24 @@ public class MesController {
try { try {
Workorder workorder = new Workorder(); Workorder workorder = new Workorder();
workorder.copyFrom(temp); workorder.copyFrom(temp);
workorderService.create(workorder); String lotSN = workorder.getLotSN();
if(ObjectUtil.isNotEmpty(lotSN)){
Workorder entity = workorderService.getOne(new LambdaQueryWrapper<Workorder>()
.eq(Workorder::getLotSN, lotSN));
if (ObjectUtil.isEmpty(entity)){
//新增
workorderService.create(workorder);
}else{
LambdaUpdateWrapper<Workorder> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(Workorder::getLotSN,lotSN);
//更新
workorder.setMode(entity.getMode());
workorder.setStatus(entity.getStatus());
workorderService.update(workorder,updateWrapper);
}
}else{
log.error("工单晶棒号为空,{}", workorder.toString());
}
} catch (Exception e) { } catch (Exception e) {
log.error("工单已存在导致新增失败,{}{}", e, e.getMessage()); log.error("工单已存在导致新增失败,{}{}", e, e.getMessage());
} }

94
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/dao/mapper/ReportMapper.xml

@ -40,40 +40,70 @@
<select id="queryYlDetail" resultType="org.nl.wms.sch.report.service.dto.YlDto"> <select id="queryYlDetail" resultType="org.nl.wms.sch.report.service.dto.YlDto">
SELECT SELECT
m.lotSN, *
p.point_code as pointCode,
p.point_name as pointName,
p.region_code as regionCode,
p.region_name as regionName,
p.vehicle_code2 as subTray,
p.vehicle_code as motherTray,
p.update_time as updateTime,
m.*
FROM FROM
sch_base_point p,sch_base_material m (
WHERE SELECT
p.vehicle_code2 = m.PalletSN m.*,
AND vehicle_code2!='' p.point_code as pointCode,
AND vehicle_code2 is not null p.point_name as pointName,
<if test="query.supplierName != null"> p.region_code as regionCode,
and m.supplierName like CONCAT('%', #{query.supplierName}, '%') p.region_name as regionName,
</if> p.vehicle_code2 as subTray,
<if test="query.productDescription != null"> p.vehicle_code as motherTray,
and m.productDescription like CONCAT('%', #{query.productDescription}, '%') p.update_time as updateTime,
</if> ( CASE WHEN ( workorder_two.status = '' OR workorder_two.status IS NULL ) THEN 0
<if test="query.point_code != null"> WHEN workorder_two.status = 2 THEN 1
and p.point_code like CONCAT('%', #{query.point_code}, '%') ELSE workorder_two.status END ) AS status,
</if> workorder_two.moname
<if test="query.region_code != null"> FROM
and p.region_code like CONCAT('%', #{query.region_code}, '%') sch_base_point p,sch_base_material m
</if> LEFT JOIN (
<if test="query.lotSN != null"> SELECT
and m.lotSN like CONCAT('%', #{query.lotSN}, '%') two.moname,
</if> two.palletSN,
<if test="query.ingotBatch != null"> two.status
and m.ingotBatch like CONCAT('%', #{query.ingotBatch}, '%') FROM
pdm_bd_workorder_two two
where two.status not in ('3','4')
GROUP BY
two.palletSN,
two.moname,
two.status
ORDER BY
two.moname,
two.palletSN,
two.status
) workorder_two ON workorder_two.palletSN = m.PalletSN
WHERE
p.vehicle_code2 = m.PalletSN
AND vehicle_code2!=''
AND vehicle_code2 is not null
<if test="query.supplierName != null">
and m.supplierName like CONCAT('%', #{query.supplierName}, '%')
</if>
<if test="query.productDescription != null">
and m.productDescription like CONCAT('%', #{query.productDescription}, '%')
</if>
<if test="query.point_code != null">
and p.point_code like CONCAT('%', #{query.point_code}, '%')
</if>
<if test="query.region_code != null">
and p.region_code like CONCAT('%', #{query.region_code}, '%')
</if>
<if test="query.lotSN != null">
and m.lotSN like CONCAT('%', #{query.lotSN}, '%')
</if>
<if test="query.ingotBatch != null">
and m.ingotBatch like CONCAT('%', #{query.ingotBatch}, '%')
</if>
ORDER BY
point_code ASC
) pp
where 1=1
<if test="query.status != null">
and pp.status = #{query.status}
</if> </if>
ORDER BY point_code ASC
</select> </select>
<select id="queryYlOutDetail" resultType="org.nl.wms.sch.report.service.dto.YCLKCDto"> <select id="queryYlOutDetail" resultType="org.nl.wms.sch.report.service.dto.YCLKCDto">

4
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/dto/YlDto.java

@ -95,4 +95,8 @@ public class YlDto implements Serializable {
* 线径 * 线径
*/ */
private String lineDiameter; private String lineDiameter;
//出库状态
private String status;
//工单
private String moname;
} }

6
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/report/service/impl/ReportServiceImpl.java

@ -135,6 +135,12 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportDto> impl
mp.put("入库时间",detailDto.getUpdateTime()); mp.put("入库时间",detailDto.getUpdateTime());
mp.put("棒源等级",detailDto.getSiliconGrade()); mp.put("棒源等级",detailDto.getSiliconGrade());
mp.put("客户来料批次号",detailDto.getIngotBatch()); mp.put("客户来料批次号",detailDto.getIngotBatch());
if("1".equals(detailDto.getStatus())){
mp.put("出库状态","出库中");
}else{
mp.put("出库状态","未出库");
}
mp.put("工单编号",detailDto.getMoname());
mp.put("晶棒号",detailDto.getLotSN()); mp.put("晶棒号",detailDto.getLotSN());
mp.put("来料长度",detailDto.getIncomingLength()); mp.put("来料长度",detailDto.getIncomingLength());
mp.put("来料重量",detailDto.getIncomingWeight()); mp.put("来料重量",detailDto.getIncomingWeight());

34
lms/nladmin-ui/src/views/wms/ycl/detail/index.vue

@ -87,13 +87,29 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="出库状态">
<el-select
v-model="query.status"
clearable
size="mini"
placeholder="全部"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.is_outing"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<rrOperation /> <rrOperation />
</el-form> </el-form>
</div> </div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'--> <!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" /> <crudOperation :permission="permission" />
<!--表格渲染--> <!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" height="550" @selection-change="crud.selectionChangeHandler"> <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" :cell-style="cellStyle" style="width: 100%;" height="550" @selection-change="crud.selectionChangeHandler">
<el-table-column prop="pointCode" label="点位编码" :min-width="flexWidth('pointCode',crud.data,'点位编码')" /> <el-table-column prop="pointCode" label="点位编码" :min-width="flexWidth('pointCode',crud.data,'点位编码')" />
<el-table-column prop="pointName" label="点位名称" :min-width="flexWidth('pointName',crud.data,'点位名称')" /> <el-table-column prop="pointName" label="点位名称" :min-width="flexWidth('pointName',crud.data,'点位名称')" />
<el-table-column v-if="false" prop="regionCode" label="区域编码" :min-width="flexWidth('regionCode',crud.data,'区域编码')" /> <el-table-column v-if="false" prop="regionCode" label="区域编码" :min-width="flexWidth('regionCode',crud.data,'区域编码')" />
@ -103,6 +119,8 @@
<el-table-column prop="supplierName" label="供应商名称" :min-width="flexWidth('supplierName',crud.data,'供应商名称')" /> <el-table-column prop="supplierName" label="供应商名称" :min-width="flexWidth('supplierName',crud.data,'供应商名称')" />
<el-table-column prop="productDescription" label="物料名称" :min-width="flexWidth('productDescription',crud.data,'物料名称')" /> <el-table-column prop="productDescription" label="物料名称" :min-width="flexWidth('productDescription',crud.data,'物料名称')" />
<el-table-column prop="productName" label="物料编码" :min-width="flexWidth('productName',crud.data,'物料编码')" /> <el-table-column prop="productName" label="物料编码" :min-width="flexWidth('productName',crud.data,'物料编码')" />
<el-table-column prop="status" label="出库状态" :formatter="format_is_outing" :min-width="flexWidth('status',crud.data,'出库状态')" />
<el-table-column prop="moname" label="工单编号" :min-width="flexWidth('moname',crud.data,'工单编号')" />
<el-table-column prop="lotSN" label="晶体编号" :min-width="flexWidth('lotSN',crud.data,'晶体编号')" /> <el-table-column prop="lotSN" label="晶体编号" :min-width="flexWidth('lotSN',crud.data,'晶体编号')" />
<el-table-column prop="ingotBatch" label="批次" :min-width="flexWidth('ingotBatch',crud.data,'批次')" /> <el-table-column prop="ingotBatch" label="批次" :min-width="flexWidth('ingotBatch',crud.data,'批次')" />
<el-table-column prop="siliconGrade" label="棒源等级" :min-width="flexWidth('siliconGrade',crud.data,'棒源等级')" /> <el-table-column prop="siliconGrade" label="棒源等级" :min-width="flexWidth('siliconGrade',crud.data,'棒源等级')" />
@ -134,6 +152,7 @@ import crudSchBasePoint from '@/views/wms/sch/point/schBasePoint'
export default { export default {
name: 'YclDetail', name: 'YclDetail',
dicts: ['is_outing'],
components: { pagination, crudOperation, rrOperation, udOperation }, components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), crud()], mixins: [presenter(), header(), crud()],
cruds() { cruds() {
@ -184,6 +203,19 @@ export default {
this.pointList = res this.pointList = res
}) })
}, },
format_is_outing(row, column) {
return this.dict.label.is_outing[row.status]
},
cellStyle({ row, column, rowIndex, columnIndex }) {
const status = row.status
if (column.property === 'status') {
if (status == '0') {
return 'background: #FFBA00'
} else if (status == '1') {
return 'background: #13ce66'
}
}
},
getNowSupplierNameList() { getNowSupplierNameList() {
crudMaterial.getNowSupplierNameList().then(res => { crudMaterial.getNowSupplierNameList().then(res => {
this.supplierNameList = res.content this.supplierNameList = res.content

Loading…
Cancel
Save