package cn.cslg.pas.controller; import cn.cslg.pas.common.core.base.Constants; import cn.cslg.pas.common.dto.business.ProductMarketDataDTO; import cn.cslg.pas.common.dto.business.ProjectOpenAuditTaskDTO; import cn.cslg.pas.common.dto.business.UpdateProductMarketDataDTO; import cn.cslg.pas.common.model.cronModel.Records; import cn.cslg.pas.common.model.request.StringRequest; import cn.cslg.pas.common.utils.Response; import cn.cslg.pas.exception.ConditionException; import cn.cslg.pas.exception.UnLoginException; import cn.cslg.pas.exception.XiaoShiException; import cn.cslg.pas.factorys.businessFactory.Business; import cn.cslg.pas.factorys.businessFactory.BusinessFactory; import cn.cslg.pas.service.business.ProjectTaskService; import io.swagger.v3.oas.annotations.Operation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; /** * 项目任务的Controller层 * @Author xiexiang * @Date 2023/11/22 */ @Slf4j @RequestMapping(Constants.API_XiaoSHI + "/projectTask") @RestController public class ProjectTaskController { @Autowired private BusinessFactory businessFactory; @Autowired private ProjectTaskService projectTaskService; @Operation(summary = "查询项目任务") @PostMapping("/addProjectOpenExamineTask") public Response addProjectOpenExamineTask(@RequestBody ProjectOpenAuditTaskDTO projectOpenAuditTaskDTO) throws Exception { Integer id = (Integer) projectTaskService.addProjectOpenExamineTask(projectOpenAuditTaskDTO); return Response.success(id); } // // @Operation(summary = "添加项目任务") // @PostMapping("/addProjectTask") // public Response addProjectTask(@RequestBody ProductMarketDataDTO productMarketDataDTO) throws Exception { // Business business = businessFactory.getClass("projectTaskService"); // Integer id = null; // try { // id = (Integer) business.addMessage(productMarketDataDTO); // } catch (Exception e){ // if(e instanceof XiaoShiException) { // return Response.error(e.getMessage()); // } else if (e instanceof UnLoginException) { // return Response.unLogin(e.getMessage()); // } else if (e instanceof ConditionException) { // return Response.conditionError(e.getMessage()); // } // } // return Response.success(id); // } // // @Operation(summary = "更新产品营销数据") // @PostMapping("/updateProductMarketData") // public Response updateProductMarketData(@RequestBody UpdateProductMarketDataDTO updateProductMarketDataDTO) throws Exception { // if (updateProductMarketDataDTO != null) { // Business business = businessFactory.getClass("projectTaskService"); // Integer id = (Integer) business.updateMessage(updateProductMarketDataDTO); // return Response.success(id); // } else { // return Response.error("网络异常"); // } // } // // @Operation(summary = "删除产品营销数据") // @PostMapping("/deleteProductMarketData") // public String deleteProductMarketData(@RequestBody List ids) throws Exception { // if (ids != null && ids.size() != 0) { // Business business = businessFactory.getClass("projectTaskService"); // business.deleteMessage(ids); // return Response.success(); // } else { // throw new XiaoShiException("需要删除的ids不能为空!"); // } // } }