优化
This commit is contained in:
@@ -288,10 +288,6 @@ public class DailyplanServiceImpl implements DailyplanService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void submit2(JSONObject form) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
String now = DateUtil.now();
|
||||
WQLObject PCS_IF_ProductPlanProc = WQLObject.getWQLObject("PCS_IF_ProductPlanProc");
|
||||
WQLObject MPS_BD_ProductDailyPlan = WQLObject.getWQLObject("MPS_BD_ProductDailyPlan");
|
||||
WQLObject MD_ME_ProducMaterialExt = WQLObject.getWQLObject("MD_ME_ProducMaterialExt");
|
||||
WQLObject MPS_BD_CapacityTemplateSeries = WQLObject.getWQLObject("MPS_BD_CapacityTemplateSeries");
|
||||
@@ -369,17 +365,10 @@ public class DailyplanServiceImpl implements DailyplanService {
|
||||
pcsn_num_day = 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){
|
||||
throw new BadRequestException("产品工艺路线未设置不允许预排!");
|
||||
}
|
||||
int total_plan_time = ProcessRoute.getInteger("total_plan_time");
|
||||
int days = (int) Math.ceil(total_plan_time/24.0);
|
||||
int days = this.getDays(jo.getString("material_id"));
|
||||
|
||||
if(pcsn_num_day > 0){
|
||||
if(pcsn_num > pcsn_num_day){
|
||||
jo.put("workorder_type","01");
|
||||
jo.put("product_weight",pcsn_num_day*standard_weight);
|
||||
jo.put("product_num",pcsn_num_day);
|
||||
jo.put("product_series_id",jo.getString("product_series"));
|
||||
@@ -394,7 +383,6 @@ public class DailyplanServiceImpl implements DailyplanService {
|
||||
fact_weight = fact_weight - pcsn_num_day*standard_weight;
|
||||
pcsn_num_day =0;
|
||||
}else{
|
||||
jo.put("workorder_type","01");
|
||||
jo.put("product_weight",fact_weight);
|
||||
jo.put("product_num",pcsn_num);
|
||||
jo.put("product_series_id",jo.getString("product_series"));
|
||||
@@ -417,7 +405,6 @@ public class DailyplanServiceImpl implements DailyplanService {
|
||||
}
|
||||
|
||||
if(pcsn_num > totalproducecapacity_qty){
|
||||
jo.put("workorder_type","01");
|
||||
jo.put("product_weight",totalproducecapacity_qty*standard_weight);
|
||||
jo.put("product_num",totalproducecapacity_qty);
|
||||
jo.put("product_series_id",jo.getString("product_series"));
|
||||
@@ -432,7 +419,6 @@ public class DailyplanServiceImpl implements DailyplanService {
|
||||
fact_weight = fact_weight - totalproducecapacity_qty*standard_weight;
|
||||
pcsn_num_day = 0;
|
||||
}else{
|
||||
jo.put("workorder_type","01");
|
||||
jo.put("product_weight",fact_weight);
|
||||
jo.put("product_num",pcsn_num);
|
||||
jo.put("product_series_id",jo.getString("product_series"));
|
||||
@@ -454,6 +440,19 @@ public class DailyplanServiceImpl implements DailyplanService {
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int getDays(String material_id) {
|
||||
JSONArray ProcessRoutes = WQL.getWO("QPDM_PRODUCTPLANPROC").addParam("flag","5")
|
||||
.addParam("material_code",material_id).process().getResultJSONArray(0);
|
||||
int days = 0;
|
||||
for(int i=0;i<ProcessRoutes.size();i++){
|
||||
JSONObject jo = ProcessRoutes.getJSONObject(i);
|
||||
int plan_time = jo.getInteger("plan_time");
|
||||
days = days + (int) Math.ceil(plan_time/24.0);
|
||||
}
|
||||
return days;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void createDay(JSONObject json) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
|
||||
@@ -107,8 +107,9 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(ProductplanprocDto dto) {
|
||||
ProductplanprocDto entity = this.findById(dto.getPlan_id());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
if (entity == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
String is_proc = dto.getIs_proc();
|
||||
if (!StrUtil.equals(IsProcEnum.GENERATE.getCode(), is_proc)) {
|
||||
throw new BadRequestException("不为生成状态,不可修改");
|
||||
@@ -458,13 +459,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
}
|
||||
}
|
||||
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){
|
||||
throw new BadRequestException("产品工艺路线未设置不允许预排!");
|
||||
}
|
||||
int total_plan_time = ProcessRoute.getInteger("total_plan_time");
|
||||
int days = (int) Math.ceil(total_plan_time/24.0);
|
||||
int days = this.getDays(jo.getString("material_id"));
|
||||
if(pcsn_num_day > 0){
|
||||
if(pcsn_num > pcsn_num_day){
|
||||
jo.put("workorder_type","01");
|
||||
@@ -570,13 +565,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
pcsn_num_day = 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){
|
||||
throw new BadRequestException("产品工艺路线未设置不允许预排!");
|
||||
}
|
||||
int total_plan_time = ProcessRoute.getInteger("total_plan_time");
|
||||
int days = (int) Math.ceil(total_plan_time/24.0);
|
||||
int days = this.getDays(jo.getString("material_id"));
|
||||
|
||||
if(pcsn_num_day > 0){
|
||||
if(pcsn_num > pcsn_num_day){
|
||||
@@ -680,13 +669,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
pcsn_num_day = 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){
|
||||
throw new BadRequestException("产品工艺路线未设置不允许预排!");
|
||||
}
|
||||
int total_plan_time = ProcessRoute.getInteger("total_plan_time");
|
||||
int days = (int) Math.ceil(total_plan_time/24.0);
|
||||
int days = this.getDays(jo.getString("material_id"));
|
||||
|
||||
if(pcsn_num_day > 0){
|
||||
if(pcsn_num > pcsn_num_day){
|
||||
@@ -805,6 +788,19 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
}
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int getDays(String material_id) {
|
||||
JSONArray ProcessRoutes = WQL.getWO("QPDM_PRODUCTPLANPROC").addParam("flag","5")
|
||||
.addParam("material_code",material_id).process().getResultJSONArray(0);
|
||||
int days = 0;
|
||||
for(int i=0;i<ProcessRoutes.size();i++){
|
||||
JSONObject jo = ProcessRoutes.getJSONObject(i);
|
||||
int plan_time = jo.getInteger("plan_time");
|
||||
days = days + (int) Math.ceil(plan_time/24.0);
|
||||
}
|
||||
return days;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void createDay(JSONObject json) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
|
||||
@@ -191,7 +191,8 @@
|
||||
IF 输入.flag = "5"
|
||||
QUERY
|
||||
SELECT
|
||||
sum( ProductProcessRouteDtl.plan_time ) AS total_plan_time
|
||||
ProductProcessRouteDtl.plan_time,
|
||||
ProductProcessRouteDtl.workprocedure_code
|
||||
FROM
|
||||
PDM_BI_ProductProcessRouteDtl ProductProcessRouteDtl
|
||||
LEFT JOIN PDM_BI_ProductProcessRoute ProductProcessRoute ON ProductProcessRoute.productprocess_id = ProductProcessRouteDtl.productprocess_id
|
||||
|
||||
@@ -118,6 +118,7 @@
|
||||
AND classstandard.is_leaf = '1'
|
||||
AND classstandard.parent_class_id <> '0'
|
||||
AND classstandard.base_data_type = '07'
|
||||
order by classstandard.class_code
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
Reference in New Issue
Block a user