湿料计划管理(修改init)

highway
wws 1 year ago
parent 605717dd11
commit a64043c4ce

@ -5,6 +5,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.mes.domain.ProOrderWorkorder;
import com.op.mes.domain.ProWetMaterialPlanDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.op.common.log.annotation.Log;
@ -29,6 +30,17 @@ public class ProWetMaterialPlanController extends BaseController {
@Autowired
private IProWetMaterialPlanService proWetMaterialPlanService;
/**
* 湿-
*
* @param detailList
* @return
*/
@PutMapping("/updatePlanDetail")
public AjaxResult updateWetMaterialPlanDetail(@RequestBody List<ProWetMaterialPlanDetail> detailList) {
return proWetMaterialPlanService.updateWetMaterialPlanDetail(detailList);
}
/**
* id湿list
*

@ -6,6 +6,7 @@ import java.util.List;
import com.op.common.core.web.domain.AjaxResult;
import com.op.mes.domain.ProOrderWorkorder;
import com.op.mes.domain.ProWetMaterialPlan;
import com.op.mes.domain.ProWetMaterialPlanDetail;
/**
* 湿Service
@ -107,4 +108,12 @@ public interface IProWetMaterialPlanService {
* @return
*/
AjaxResult getWetMaterialPlanDetailListById(String id);
/**
* 湿-
*
* @param detailList
* @return
*/
AjaxResult updateWetMaterialPlanDetail(List<ProWetMaterialPlanDetail> detailList);
}

@ -220,13 +220,40 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService
public AjaxResult getWetMaterialPlanDetailListById(String id) {
List<ProWetMaterialPlanDetail> detailList = proWetMaterialPlanDetailMapper.selectProWetMaterialPlanDetailListById(id);
// 获取班次名称和料罐名称
for (int i = 0;i < detailList.size();i++){
for (int i = 0; i < detailList.size(); i++) {
detailList.get(i).setShiftDesc(proWetMaterialPlanMapper.selectShiftById(String.valueOf(detailList.get(i).getShiftId())));
detailList.get(i).setBucketName(proWetMaterialPlanMapper.selectBucketNameById(detailList.get(i).getBucketId()));
}
return success(detailList);
}
/**
* 湿-
*
* @param detailList
* @return
*/
@Override
@DS("#header.poolName")
@Transactional
public AjaxResult updateWetMaterialPlanDetail(List<ProWetMaterialPlanDetail> detailList) {
// 获取该计划详情下的主计划信息
ProWetMaterialPlan proWetMaterialPlan = proWetMaterialPlanMapper.selectProWetMaterialPlanById(detailList.get(0).getWetMaterialPlanId());
// 更新主计划信息
// 更新人
proWetMaterialPlan.setUpdateBy(SecurityContextHolder.getUserName());
// 更新时间
proWetMaterialPlan.setUpdateTime(DateUtils.getNowDate());
// 更新至数据库
proWetMaterialPlanMapper.updateProWetMaterialPlan(proWetMaterialPlan);
// 循环将详情信息更新至数据库
for (int i = 0; i < detailList.size(); i++) {
proWetMaterialPlanDetailMapper.updateProWetMaterialPlanDetail(detailList.get(i));
}
return success();
}
/**
* 湿
*

Loading…
Cancel
Save