物料页面修改
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);
|
||||
|
||||
Reference in New Issue
Block a user