优化
This commit is contained in:
@@ -62,7 +62,7 @@ public class DailyplanServiceImpl implements DailyplanService {
|
||||
map.put("material_code", "%" + material_code + "%");
|
||||
}
|
||||
map.put("flag", "1");
|
||||
JSONObject jret = WQL.getWO("QPDM_PRODUCTDAILYPLAN").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "pp.planstart_date desc");
|
||||
JSONObject jret = WQL.getWO("QPDM_PRODUCTDAILYPLAN").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "pp.planstart_date");
|
||||
JSONArray json = jret.getJSONArray("content");
|
||||
JSONArray ja = new JSONArray();
|
||||
for(int i=0;i<json.size();i++){
|
||||
|
||||
@@ -198,7 +198,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
JSONObject jo = ja.getJSONObject(i);
|
||||
JSONObject jsonMst = PCS_IF_ProductPlanProc.query("plan_id ='" + jo.getString("plan_id") + "' and is_proc = '0'").uniqueResult(0);
|
||||
if (jsonMst == null) {
|
||||
throw new BadRequestException("当前记录状态异常,操作失败!");
|
||||
continue;
|
||||
}
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("is_proc", status);
|
||||
@@ -384,8 +384,8 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
|
||||
double fact_weight = jo.getDouble("fact_weight");
|
||||
double standard_weight = jo.getDouble("standard_weight");
|
||||
//批次数
|
||||
BigDecimal pcsn_num = NumberUtil.round(fact_weight/standard_weight,0);
|
||||
//批次数NumberUtil.ceil(fact_weight/standard_weight)
|
||||
double pcsn_num = Math.ceil(fact_weight/standard_weight);
|
||||
|
||||
JSONObject series = MPS_BD_CapacityTemplateSeries.query("captemplate_id='"+captemplate_id+"' and product_series_id='"+jo.getString("product_series")+"'").uniqueResult(0);
|
||||
if(series ==null){
|
||||
@@ -395,7 +395,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
int totalproducecapacity_qty = series.getInteger("totalproducecapacity_qty");
|
||||
//若初始日期不为空,取此初始日期
|
||||
if(finalChecked.equals("true") && StrUtil.isNotEmpty(nowstart_date)){
|
||||
while(pcsn_num.intValue() > 0){
|
||||
while(pcsn_num > 0){
|
||||
JSONObject ProcessRoute = WQL.getWO("QPDM_PRODUCTPLANPROC").addParam("flag","5")
|
||||
.addParam("material_code",jo.getString("material_id")).process().uniqueResult(0);
|
||||
if(ProcessRoute==null){
|
||||
@@ -404,7 +404,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
int total_plan_time = ProcessRoute.getInteger("total_plan_time");
|
||||
BigDecimal days = NumberUtil.round(total_plan_time/24,0);
|
||||
|
||||
if(pcsn_num.intValue() > totalproducecapacity_qty){
|
||||
if(pcsn_num > totalproducecapacity_qty){
|
||||
jo.put("workorder_type","01");
|
||||
jo.put("product_weight",totalproducecapacity_qty*standard_weight);
|
||||
jo.put("product_num",totalproducecapacity_qty);
|
||||
@@ -416,11 +416,11 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
this.createDay(jo);
|
||||
|
||||
date = DateUtil.offsetDay(date,1);
|
||||
pcsn_num = BigDecimal.valueOf(pcsn_num.intValue() - totalproducecapacity_qty);
|
||||
pcsn_num = pcsn_num - totalproducecapacity_qty;
|
||||
}else{
|
||||
jo.put("workorder_type","01");
|
||||
jo.put("product_weight",pcsn_num.intValue()*standard_weight);
|
||||
jo.put("product_num",pcsn_num.intValue());
|
||||
jo.put("product_weight",pcsn_num*standard_weight);
|
||||
jo.put("product_num",pcsn_num);
|
||||
jo.put("product_series_id",jo.getString("product_series"));
|
||||
jo.put("planstart_date",DateUtil.formatDate(date));
|
||||
|
||||
@@ -429,7 +429,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
this.createDay(jo);
|
||||
|
||||
date = DateUtil.offsetDay(date,1);
|
||||
pcsn_num = BigDecimal.valueOf(0);
|
||||
pcsn_num = 0;
|
||||
}
|
||||
}
|
||||
}else{//若初始日期为空,获取日计划表设备标识=此分组设备的最后一个计划
|
||||
@@ -445,7 +445,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
date = DateUtil.parse(nowstart_date);
|
||||
date = DateUtil.offsetDay(date,1);
|
||||
|
||||
while(pcsn_num.intValue() > 0){
|
||||
while(pcsn_num > 0){
|
||||
JSONObject ProcessRoute = WQL.getWO("QPDM_PRODUCTPLANPROC").addParam("flag","5")
|
||||
.addParam("material_code",jo.getString("material_id")).process().uniqueResult(0);
|
||||
if(ProcessRoute==null){
|
||||
@@ -454,7 +454,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
int total_plan_time = ProcessRoute.getInteger("total_plan_time");
|
||||
BigDecimal days = NumberUtil.round(total_plan_time/24,0);
|
||||
|
||||
if(pcsn_num.intValue() > totalproducecapacity_qty){
|
||||
if(pcsn_num > totalproducecapacity_qty){
|
||||
jo.put("workorder_type","01");
|
||||
jo.put("product_weight",totalproducecapacity_qty*standard_weight);
|
||||
jo.put("product_num",totalproducecapacity_qty);
|
||||
@@ -466,11 +466,11 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
this.createDay(jo);
|
||||
|
||||
date = DateUtil.offsetDay(date,1);
|
||||
pcsn_num = BigDecimal.valueOf(pcsn_num.intValue() - totalproducecapacity_qty);
|
||||
pcsn_num =pcsn_num - totalproducecapacity_qty;
|
||||
}else{
|
||||
jo.put("workorder_type","01");
|
||||
jo.put("product_weight",pcsn_num.intValue()*standard_weight);
|
||||
jo.put("product_num",pcsn_num.intValue());
|
||||
jo.put("product_weight",pcsn_num*standard_weight);
|
||||
jo.put("product_num",pcsn_num);
|
||||
jo.put("product_series_id",jo.getString("product_series"));
|
||||
jo.put("planstart_date",DateUtil.formatDate(date));
|
||||
|
||||
@@ -479,7 +479,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
this.createDay(jo);
|
||||
|
||||
date = DateUtil.offsetDay(date,1);
|
||||
pcsn_num = BigDecimal.valueOf(0);
|
||||
pcsn_num = 0;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
@@ -487,7 +487,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
date = DateUtil.parse(nowstart_date);
|
||||
date = DateUtil.offsetDay(date,1);
|
||||
|
||||
while(pcsn_num.intValue() > 0){
|
||||
while(pcsn_num > 0){
|
||||
JSONObject ProcessRoute = WQL.getWO("QPDM_PRODUCTPLANPROC").addParam("flag","5")
|
||||
.addParam("material_code",jo.getString("material_id")).process().uniqueResult(0);
|
||||
if(ProcessRoute==null){
|
||||
@@ -496,7 +496,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
int total_plan_time = ProcessRoute.getInteger("total_plan_time");
|
||||
BigDecimal days = NumberUtil.round(total_plan_time/24,0);
|
||||
|
||||
if(pcsn_num.intValue() > totalproducecapacity_qty){
|
||||
if(pcsn_num > totalproducecapacity_qty){
|
||||
jo.put("workorder_type","01");
|
||||
jo.put("product_weight",totalproducecapacity_qty*standard_weight);
|
||||
jo.put("product_num",totalproducecapacity_qty);
|
||||
@@ -508,11 +508,11 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
this.createDay(jo);
|
||||
|
||||
date = DateUtil.offsetDay(date,1);
|
||||
pcsn_num = BigDecimal.valueOf(pcsn_num.intValue() - totalproducecapacity_qty);
|
||||
pcsn_num = pcsn_num - totalproducecapacity_qty;
|
||||
}else{
|
||||
jo.put("workorder_type","01");
|
||||
jo.put("product_weight",pcsn_num.intValue()*standard_weight);
|
||||
jo.put("product_num",pcsn_num.intValue());
|
||||
jo.put("product_weight",pcsn_num*standard_weight);
|
||||
jo.put("product_num",pcsn_num);
|
||||
jo.put("product_series_id",jo.getString("product_series"));
|
||||
jo.put("planstart_date",DateUtil.formatDate(date));
|
||||
|
||||
@@ -521,7 +521,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
this.createDay(jo);
|
||||
|
||||
date = DateUtil.offsetDay(date,1);
|
||||
pcsn_num = BigDecimal.valueOf(0);
|
||||
pcsn_num = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
ext.standard_weight_pft AS standard_weight,
|
||||
materialbase.material_code,
|
||||
deviceinfo.device_code,
|
||||
deviceinfo.device_name,
|
||||
productdeptpcsn.org_id
|
||||
FROM
|
||||
MPS_BD_ProductDailyPlan pp
|
||||
@@ -100,6 +101,7 @@
|
||||
ext.standard_weight_pft AS standard_weight,
|
||||
materialbase.material_code,
|
||||
deviceinfo.device_code,
|
||||
deviceinfo.device_name,
|
||||
classstandard.class_name AS product_series_name,
|
||||
classstandard2.class_name AS mater_product_series_name,
|
||||
productdeptpcsn.org_id
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
输入.device_id TYPEAS s_string
|
||||
输入.product_series TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -88,7 +89,7 @@
|
||||
materialbase.material_type_id,
|
||||
ext.product_series,
|
||||
deviceinfo.device_id,
|
||||
deviceinfo.device_code
|
||||
deviceinfo.device_name
|
||||
FROM
|
||||
PCS_IF_ProductPlanProc pp
|
||||
LEFT JOIN MD_ME_ProducMaterialExt ext ON pp.material_id = ext.material_id
|
||||
|
||||
Reference in New Issue
Block a user