| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import zy.cloud.wms.common.web.BaseController; |
| | | import zy.cloud.wms.manager.entity.Cstmr; |
| | | import zy.cloud.wms.manager.entity.Item; |
| | | import zy.cloud.wms.manager.entity.ProjectPlan; |
| | | import zy.cloud.wms.manager.entity.ProjectType; |
| | | import zy.cloud.wms.manager.service.CstmrService; |
| | | import zy.cloud.wms.manager.service.ItemService; |
| | | import zy.cloud.wms.manager.service.ProjectPlanService; |
| | | import zy.cloud.wms.manager.service.ProjectTypeService; |
| | | import zy.cloud.wms.manager.entity.*; |
| | | import zy.cloud.wms.manager.service.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | |
| | | private ItemService itemService; |
| | | @Autowired |
| | | private ProjectPlanService planService; |
| | | @Autowired |
| | | private FlowStatusService flowStatusService; |
| | | |
| | | @RequestMapping(value = "/item/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 初始化生成项目节点 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/item/initPlan/auth") |
| | | @ManagerAuth |
| | | public R initPlan(@RequestParam("id") String param){ |
| | | if (param != null){ |
| | | List<ProjectPlan> projectPlans = planService.selectList(new EntityWrapper<ProjectPlan>().eq("item_id",param)); |
| | | if(!Cools.isEmpty(projectPlans) && projectPlans.size()>0){ |
| | | return R.error("该项目已有节点计划"); |
| | | } |
| | | List<FlowStatus> flowStatuses = flowStatusService.selectList(new EntityWrapper<FlowStatus>()); |
| | | if(!Cools.isEmpty(flowStatuses) && flowStatuses.size()>0){ |
| | | for(FlowStatus flowStatus : flowStatuses){ |
| | | ProjectPlan projectPlan = new ProjectPlan(); |
| | | projectPlan.setItemId(Long.parseLong(param)); |
| | | projectPlan.setWeightNum(flowStatus.getWeightNum()); |
| | | projectPlan.setFlowId(flowStatus.getId()); |
| | | planService.insert(projectPlan); |
| | | } |
| | | } else { |
| | | return R.error("项目计划节点基础数据为空"); |
| | | } |
| | | } else { |
| | | return R.error("项目参数错误"); |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |