物料页面修改
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
package org.nl.wms.database.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.database.service.MaterialService;
|
||||
import org.nl.wms.database.service.dto.MaterialDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -63,5 +64,13 @@ public class MaterialController {
|
||||
mdMeMaterialService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@Log("同步物料")
|
||||
@ApiOperation("同步物料")
|
||||
//@PreAuthorize("@el.check('mdMeMaterial:del')")
|
||||
@PostMapping("/synchro")
|
||||
public ResponseEntity<Object> synchro(@RequestBody JSONObject param) {
|
||||
mdMeMaterialService.synchro(param);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
package org.nl.wms.database.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.database.service.dto.MaterialDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
@@ -60,5 +61,10 @@ public interface MaterialService {
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
/**
|
||||
* 同步物料
|
||||
* @param /
|
||||
*/
|
||||
void synchro( JSONObject param);
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.wms.database.service.MaterialService;
|
||||
import org.nl.wms.database.service.dto.MaterialDto;
|
||||
import org.nl.wms.ext.acs.rest.WmsToJnController;
|
||||
import org.nl.wms.ext.acs.service.impl.WmsToJnServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -43,11 +45,11 @@ public class MaterialServiceImpl implements MaterialService {
|
||||
String name = (String) whereJson.get("name");
|
||||
String sql = "1=1";
|
||||
if (StrUtil.isNotEmpty(name)) {
|
||||
sql = " (material_code like '%"+name+"%' OR material_code like '%"+name+"%')";
|
||||
sql = " (material_code like '%" + name + "%' OR material_name like '%" + name + "%')";
|
||||
}
|
||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), sql + " and is_delete='0'", "update_time desc");
|
||||
final JSONObject json = rb.pageResult();
|
||||
log.info("json:{}",json);
|
||||
log.info("json:{}", json);
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -145,4 +147,11 @@ public class MaterialServiceImpl implements MaterialService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void synchro(JSONObject param) {
|
||||
WmsToJnServiceImpl wmsToJnService = new WmsToJnServiceImpl();
|
||||
wmsToJnService.synchroMaterial(new JSONObject());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public class ProducetaskServiceImpl implements ProducetaskService {
|
||||
//编码唯一性校验
|
||||
String producetask_code = dto.getProducetask_code();
|
||||
ProducetaskDto byCode = this.findByCode(producetask_code);
|
||||
// if (ObjectUtil.isNotEmpty(byCode)) throw new BadRequestException("编码已存在!");
|
||||
// if (ObjectUtil.isNotEmpty(byCode)) throw new BadRequestException("编码已存在!");
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
@@ -277,6 +277,12 @@ public class ProducetaskServiceImpl implements ProducetaskService {
|
||||
String now = DateUtil.now();
|
||||
String producetask_id = param.getString("producetask_id");
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_mg_producetask");
|
||||
String device_id = param.getString("device_id");
|
||||
WQLObject taskTable = WQLObject.getWQLObject("PDM_MG_produceTask");
|
||||
JSONObject jo = taskTable.query("device_id='" + device_id + "' and producetask_status in ('02','03','04')").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jo)) {
|
||||
throw new BadRequestException("该设备存在未完成的工单,不能下发!");
|
||||
}
|
||||
JSONObject taskObj = WQL.getWO("PDM_ProduceTask_01").addParam("flag", "3").addParam("producetask_id", producetask_id).process().uniqueResult(0);
|
||||
taskObj.put("product_code", "wms");
|
||||
WmsToAcsService wmsToAcsService = SpringContextHolder.getBean(WmsToAcsService.class);
|
||||
|
||||
@@ -24,4 +24,12 @@ export function edit(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
export function synchro(data) {
|
||||
return request({
|
||||
url: 'api/mdMeMaterial/synchro',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, synchro }
|
||||
|
||||
@@ -6,10 +6,22 @@
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label" />
|
||||
<el-input v-model="query.name" clearable placeholder="输入名称或编码" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission" >
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="info"
|
||||
icon="el-icon-s-comment"
|
||||
size="mini"
|
||||
@click="is_sys"
|
||||
>
|
||||
同步
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="550px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
|
||||
@@ -116,6 +128,7 @@ import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudProducetask from '@/api/wms/pdm/producetask'
|
||||
|
||||
const defaultForm = {
|
||||
material_id: null,
|
||||
@@ -246,7 +259,13 @@ export default {
|
||||
},
|
||||
handleChange(value) {
|
||||
console.log(value)
|
||||
}
|
||||
},
|
||||
is_sys() {
|
||||
crudMdMeMaterial.synchro({ producetask_id:'' }).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -467,7 +467,8 @@ export default {
|
||||
})
|
||||
},
|
||||
is_sue() {
|
||||
crudProducetask.issued({ producetask_id: this.currentRow.producetask_id }).then(res => {
|
||||
debugger
|
||||
crudProducetask.issued({ producetask_id: this.currentRow.producetask_id, device_id: this.currentRow.device_id }).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
this.issue = true
|
||||
|
||||
Reference in New Issue
Block a user