|
|
@ -245,7 +245,6 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A |
|
|
|
for(int i=0; i<tableData.size(); i++){ |
|
|
|
JSONObject jsonObject = tableData.getJSONObject(i); |
|
|
|
ProduceshiftorderdetailDto detaildto = JSON.toJavaObject(jsonObject,ProduceshiftorderdetailDto.class); |
|
|
|
String order_detral_code = CodeUtil.getNewCode("ORDER_DETAIL_NO"); |
|
|
|
//客户标识
|
|
|
|
String customer_id = detaildto.getCust_id(); |
|
|
|
//客户编码
|
|
|
@ -292,7 +291,9 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A |
|
|
|
public void update(ProduceshiftorderDto dto) { |
|
|
|
ProduceshiftorderDto entity = this.findById(dto.getOrder_id()); |
|
|
|
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); |
|
|
|
|
|
|
|
if(!StrUtil.equals(entity.getOrder_status(),"00")){ |
|
|
|
throw new BadRequestException("单据状态非就绪,删除失败!"); |
|
|
|
} |
|
|
|
String currentUsername = SecurityUtils.getCurrentUsername(); |
|
|
|
String now = DateUtil.now(); |
|
|
|
dto.setUpdate_time(now); |
|
|
@ -318,7 +319,6 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A |
|
|
|
public void update(Map whereJson) { |
|
|
|
JSONObject param=new JSONObject(whereJson); |
|
|
|
String currentUsername = SecurityUtils.getCurrentUsername(); |
|
|
|
ProduceshiftorderDto orderDto = new ProduceshiftorderDto(); |
|
|
|
String order_id = MapUtil.getStr(whereJson, "order_id"); |
|
|
|
String order_code = MapUtil.getStr(whereJson, "order_code"); |
|
|
|
String material_id = MapUtil.getStr(whereJson, "material_id"); |
|
|
@ -339,26 +339,35 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A |
|
|
|
|
|
|
|
ProduceshiftorderDto entity = this.findById(order_id); |
|
|
|
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); |
|
|
|
orderDto.setMaterial_code(material_code); |
|
|
|
orderDto.setMaterial_name(material_name); |
|
|
|
orderDto.setMaterial_spec(material_spec); |
|
|
|
orderDto.setMaterial_uuid(material_id); |
|
|
|
orderDto.setLength(length); |
|
|
|
orderDto.setOuter_diameter(outer_diameter); |
|
|
|
orderDto.setWall_thickness(wall_thickness); |
|
|
|
orderDto.setOrder_code(order_code); |
|
|
|
orderDto.setQty(qty); |
|
|
|
orderDto.setCreate_by(currentUsername); |
|
|
|
orderDto.setIs_coating("1"); |
|
|
|
orderDto.setIs_labeling("1"); |
|
|
|
orderDto.setIs_lettering("1"); |
|
|
|
orderDto.setIs_risking("1"); |
|
|
|
orderDto.setIs_strapping("1"); |
|
|
|
orderDto.setIs_unbundling("1"); |
|
|
|
|
|
|
|
if(!StrUtil.equals(entity.getOrder_status(),"00")){ |
|
|
|
throw new BadRequestException("单据状态非就绪,删除失败!"); |
|
|
|
} |
|
|
|
entity.setOrder_id(order_id); |
|
|
|
entity.setMaterial_code(material_code); |
|
|
|
entity.setMaterial_name(material_name); |
|
|
|
entity.setMaterial_spec(material_spec); |
|
|
|
entity.setMaterial_uuid(material_id); |
|
|
|
entity.setLength(length); |
|
|
|
entity.setOuter_diameter(outer_diameter); |
|
|
|
entity.setWall_thickness(wall_thickness); |
|
|
|
entity.setOrder_code(order_code); |
|
|
|
entity.setQty(qty); |
|
|
|
entity.setCreate_by(currentUsername); |
|
|
|
entity.setIs_coating("1"); |
|
|
|
entity.setIs_labeling("1"); |
|
|
|
entity.setIs_lettering("1"); |
|
|
|
entity.setIs_risking("1"); |
|
|
|
entity.setIs_strapping("1"); |
|
|
|
entity.setIs_unbundling("1"); |
|
|
|
this.update(entity); |
|
|
|
|
|
|
|
WQLObject detailTab = WQLObject.getWQLObject("acs_produceshiftorderdetail"); |
|
|
|
JSONObject data = detailTab.query("order_id ='" + order_id + "'").uniqueResult(0); |
|
|
|
if (!ObjectUtil.isEmpty(data)) { |
|
|
|
detailTab.delete("order_id = '" + order_id + "'"); |
|
|
|
} |
|
|
|
for(int i=0; i<tableData.size(); i++){ |
|
|
|
JSONObject jsonObject = tableData.getJSONObject(i); |
|
|
|
String order_detail_id = jsonObject.getString("order_detail_id"); |
|
|
|
//客户标识
|
|
|
|
String customer_id = jsonObject.getString("cust_id"); |
|
|
|
//客户编码
|
|
|
@ -377,15 +386,19 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A |
|
|
|
String strap_number = jsonObject.getString("strap_number"); |
|
|
|
//尾料数量
|
|
|
|
String strap_tailint_number = String.valueOf(Integer.parseInt(detail_qty)%Integer.parseInt(strap_number)); |
|
|
|
//贴标模板
|
|
|
|
String labeling_template = jsonObject.getString("labeling_template"); |
|
|
|
//优先级
|
|
|
|
String priority = jsonObject.getString("priority"); |
|
|
|
|
|
|
|
ProduceshiftorderdetailDto detaildto = produceshiftorderdetailService.findById(order_detail_id); |
|
|
|
|
|
|
|
if(!ObjectUtil.isEmpty(detaildto)){ |
|
|
|
ProduceshiftorderdetailDto detaildto = new ProduceshiftorderdetailDto(); |
|
|
|
detaildto.setOrder_id(order_id); |
|
|
|
detaildto.setOrder_code(order_code); |
|
|
|
detaildto.setOrder_detail_qty(detail_qty); |
|
|
|
detaildto.setOrder_detail_status("00"); |
|
|
|
detaildto.setOrder_qty(qty); |
|
|
|
detaildto.setIs_deleted("0"); |
|
|
|
detaildto.setOrder_detail_id(IdUtil.simpleUUID()); |
|
|
|
detaildto.setOrder_detail_code(String.valueOf(i+1)); |
|
|
|
detaildto.setCust_id(customer_id); |
|
|
|
detaildto.setCust_code(customer_code); |
|
|
@ -396,48 +409,14 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A |
|
|
|
detaildto.setLength(length); |
|
|
|
detaildto.setWall_thickness(wall_thickness); |
|
|
|
detaildto.setOuter_diameter(outer_diameter); |
|
|
|
detaildto.setLabeling_message(lettering_message); |
|
|
|
detaildto.setStrap_number(strap_number); |
|
|
|
detaildto.setStrap_tailint_number(strap_tailint_number); |
|
|
|
detaildto.setLettering_icon(lettering_icon); |
|
|
|
detaildto.setLabeling_template(labeling_template); |
|
|
|
detaildto.setLettering_message(lettering_message); |
|
|
|
detaildto.setLettering_message2(lettering_message2); |
|
|
|
produceshiftorderdetailService.update(detaildto); |
|
|
|
// WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorderdetail");
|
|
|
|
// JSONObject json= (JSONObject) JSONObject.toJSON(detaildto);
|
|
|
|
// wo.update(json);
|
|
|
|
|
|
|
|
} else { |
|
|
|
detaildto = new ProduceshiftorderdetailDto(); |
|
|
|
detaildto.setOrder_id(order_id); |
|
|
|
detaildto.setOrder_code(order_code); |
|
|
|
detaildto.setOrder_detail_status("00"); |
|
|
|
detaildto.setOrder_qty(qty); |
|
|
|
detaildto.setIs_deleted("0"); |
|
|
|
detaildto.setOrder_detail_id(IdUtil.simpleUUID()); |
|
|
|
detaildto.setOrder_detail_code(String.valueOf(i+1)); |
|
|
|
detaildto.setCust_id(customer_id); |
|
|
|
detaildto.setCust_code(customer_code); |
|
|
|
detaildto.setCust_name(customer_name); |
|
|
|
detaildto.setMaterial_code(material_code); |
|
|
|
detaildto.setMaterial_id(material_id); |
|
|
|
detaildto.setMaterial_name(material_name); |
|
|
|
detaildto.setLength(length); |
|
|
|
detaildto.setWall_thickness(wall_thickness); |
|
|
|
detaildto.setOuter_diameter(outer_diameter); |
|
|
|
detaildto.setLabeling_message(lettering_message); |
|
|
|
detaildto.setLettering_icon(lettering_icon); |
|
|
|
detaildto.setStrap_number(strap_number); |
|
|
|
detaildto.setStrap_tailint_number(strap_tailint_number); |
|
|
|
produceshiftorderdetailService.create(detaildto); |
|
|
|
|
|
|
|
// WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorderdetail");
|
|
|
|
// JSONObject json = (JSONObject) JSONObject.toJSON(detaildto);
|
|
|
|
// wo.insert(json);
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|