Browse Source

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

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

44
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.JSONObject;
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.ApiOperation;
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.dao.PdmBdWorkorder;
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.mapper.MaterialMapper;
import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum;
@ -46,6 +49,9 @@ public class MesController {
@Autowired
private MaterialMapper materialMapper;
@Autowired
private IMaterialService materialService;
@Autowired
private IPdmBdWorkorderService pdmBdWorkorderService;
@ -74,13 +80,32 @@ public class MesController {
head.setSRC_SYSTEM("AGV");
qpmes060Response.setHEAD(head);
try {
Material material = new Material();
for(QPMES060RequestBody QPMES060RequestBody:notice.toJavaObject(QPMES060Request.class).getBODY()) {
Material material = new Material();
//实体类
material.copyFrom(QPMES060RequestBody);
String lotSN = material.getLotSN();
if(ObjectUtil.isNotEmpty(lotSN)){
Material entity = materialService.getOne(new LambdaQueryWrapper<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.setSTATUS("S");
@ -214,7 +239,24 @@ public class MesController {
try {
Workorder workorder = new Workorder();
workorder.copyFrom(temp);
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) {
log.error("工单已存在导致新增失败,{}{}", e, e.getMessage());
}

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

@ -40,7 +40,11 @@
<select id="queryYlDetail" resultType="org.nl.wms.sch.report.service.dto.YlDto">
SELECT
m.lotSN,
*
FROM
(
SELECT
m.*,
p.point_code as pointCode,
p.point_name as pointName,
p.region_code as regionCode,
@ -48,9 +52,29 @@
p.vehicle_code2 as subTray,
p.vehicle_code as motherTray,
p.update_time as updateTime,
m.*
( CASE WHEN ( workorder_two.status = '' OR workorder_two.status IS NULL ) THEN 0
WHEN workorder_two.status = 2 THEN 1
ELSE workorder_two.status END ) AS status,
workorder_two.moname
FROM
sch_base_point p,sch_base_material m
LEFT JOIN (
SELECT
two.moname,
two.palletSN,
two.status
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!=''
@ -73,7 +97,13 @@
<if test="query.ingotBatch != null">
and m.ingotBatch like CONCAT('%', #{query.ingotBatch}, '%')
</if>
ORDER BY point_code ASC
ORDER BY
point_code ASC
) pp
where 1=1
<if test="query.status != null">
and pp.status = #{query.status}
</if>
</select>
<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 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.getSiliconGrade());
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.getIncomingLength());
mp.put("来料重量",detailDto.getIncomingWeight());

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

@ -87,13 +87,29 @@
/>
</el-select>
</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 />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<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="pointName" label="点位名称" :min-width="flexWidth('pointName',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="productDescription" label="物料名称" :min-width="flexWidth('productDescription',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="ingotBatch" label="批次" :min-width="flexWidth('ingotBatch',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 {
name: 'YclDetail',
dicts: ['is_outing'],
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), crud()],
cruds() {
@ -184,6 +203,19 @@ export default {
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() {
crudMaterial.getNowSupplierNameList().then(res => {
this.supplierNameList = res.content

Loading…
Cancel
Save