chenlu
4 小时以前 33dbc6a161554f3a897f9e9273feb4f2c1b47381
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java
@@ -2,20 +2,22 @@
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.example.erp.common.Constants;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.sd.DeliveryDetail;
import com.example.erp.entity.sd.Order;
import com.example.erp.common.Result;
import com.example.erp.entity.sd.OrderDetail;
import com.example.erp.entity.sd.OrderGlassDetail;
import com.example.erp.dto.pp.FlowCardDTO;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.exception.ServiceException;
import com.example.erp.service.pp.FlowCardService;
import com.example.erp.tools.DownExcel;
import com.fasterxml.jackson.core.JsonProcessingException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.sql.Date;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@RestController
@@ -28,26 +30,24 @@
    //流程卡管理查询
    @ApiOperation("流程卡管理查询接口")
    @SaCheckPermission("selectProcessCard.search")
    @PostMapping("/flowCard/{pageNum}/{pageSize}/{selectTime1}/{selectTime2}")
    @PostMapping("/flowCard/{pageNum}/{pageSize}/{selectDate}")
    public Result dateProcess(
            @PathVariable Integer pageNum,
            @PathVariable Integer pageSize,
            @PathVariable Date selectTime1,
            @PathVariable Date selectTime2,
            @PathVariable List<String> selectDate,
            @RequestBody FlowCard flowCard) {
        return Result.seccess(flowCardService.selectProcessCard(pageNum, pageSize, selectTime1, selectTime2, flowCard));
        return Result.success(flowCardService.selectProcessCard(pageNum, pageSize,selectDate, flowCard));
    }
    //分架查询
    @ApiOperation("分架查询接口")
    @SaCheckPermission("selectAddProcess.search")
    @PostMapping("/selectAddProcess/{selectTime1}/{selectTime2}")
    @PostMapping("/selectAddProcess/{selectDate}")
    public Result selectAddProcess(
            @PathVariable Date selectTime1,
            @PathVariable Date selectTime2,
            @PathVariable List<String> selectDate,
            @RequestBody FlowCard flowCard) {
        return Result.seccess(flowCardService.selectAddProcess(selectTime1, selectTime2, flowCard));
        return Result.success(flowCardService.selectAddProcess(selectDate, flowCard));
    }
    //分架明细查询
@@ -57,7 +57,7 @@
    public Result detailsSelect(
            @PathVariable String orderId,
            @RequestBody FlowCard flowCard) {
        return Result.seccess(flowCardService.detailsSelectSv(orderId, flowCard));
        return Result.success(flowCardService.detailsSelectSv(orderId, flowCard));
    }
@@ -73,12 +73,12 @@
            @PathVariable String userName
    ) {
//        if(flowCardService.deleteFlowCardSv(orderId,processId)){
//            return Result.seccess();
//            return Result.success();
//        }else {
//            throw new ServiceException(Constants.Code_500,"删除失败,请检查是否已报工");
//
//        }
        return Result.seccess(flowCardService.deleteFlowCardSv(orderId, processId,userId,userName));
        return Result.success(flowCardService.deleteFlowCardSv(orderId, processId,userId,userName));
    }
    //修改排版状态
@@ -90,7 +90,7 @@
            @PathVariable Integer state
    ) {
        if (flowCardService.updateLayoutStatusSv(processId, state)) {
            return Result.seccess();
            return Result.success();
        } else {
            throw new ServiceException(Constants.Code_500, "修改失败");
@@ -98,13 +98,25 @@
    }
    //分架新增明细查询
    @ApiOperation("分架明细新增接口")
    @ApiOperation("分架新增明细查询")
    @PostMapping("/selectNoCard/{orderId}/{productionId}")
    public Result SelectNoCard(
            @PathVariable String orderId,
            @PathVariable String productionId,
            @RequestBody FlowCard flowCard) {
        return Result.seccess(flowCardService.selectNoCardSv(orderId, productionId, flowCard));
        return Result.success(flowCardService.selectNoCardSv(orderId, productionId, flowCard));
    }
    @ApiOperation("分架新增明细排序查询")
    @PostMapping("/selectSortingCard/{orderId}/{productionId}/{flashback}/{optionVal}")
    public Result selectSortingCard(
            @PathVariable String orderId,
            @PathVariable String productionId,
            @PathVariable String flashback,
            @PathVariable String optionVal,
            @RequestBody FlowCard flowCard) {
        return Result.success(flowCardService.selectSortingCardSv(orderId, productionId,flashback,optionVal, flowCard));
    }
@@ -114,7 +126,7 @@
    @PostMapping("/addFlowCard/{orderId}")
    public Result AddOrderWork(@PathVariable String orderId,@RequestBody Map<String, Object> object) {
        if (flowCardService.addFlowCardSv(orderId,object)) {
            return Result.seccess();
            return Result.success();
        } else {
            throw new ServiceException(Constants.Code_500, "保存失败");
@@ -128,7 +140,7 @@
            @PathVariable String selectTime1,
            @PathVariable String selectTime2,
            @RequestBody FlowCard flowCard) {
        return Result.seccess(flowCardService.selectLastScheduling(selectTime1, selectTime2, flowCard));
        return Result.success(flowCardService.selectLastScheduling(selectTime1, selectTime2, flowCard));
    }
@@ -142,7 +154,7 @@
            @PathVariable String processes,
            @PathVariable Integer state,
            @RequestBody FlowCard flowCard) {
        return Result.seccess(flowCardService.selectSchedulingSv(selectTime1, selectTime2, orderId, processes, state, flowCard));
        return Result.success(flowCardService.selectSchedulingSv(selectTime1, selectTime2, orderId, processes, state, flowCard));
    }
@@ -153,21 +165,21 @@
    public Result flowCardDetail(
            @PathVariable String processId,
            @RequestBody FlowCard flowCard) {
        return Result.seccess(flowCardService.flowCardDetailSv(processId, flowCard));
        return Result.success(flowCardService.flowCardDetailSv(processId, flowCard));
    }
    @ApiOperation("流程卡打印查询接口")
    @SaCheckPermission("selectPrintFlowCard.search")
    @PostMapping("/selectPrintFlowCard/{selectTime1}/{selectTime2}/{orderId}/{project}/{userId}")
    @PostMapping("/selectPrintFlowCard/{selectDate}/{orderId}/{project}/{userId}/{state}")
    public Result selectPrintFlowCard(
            @PathVariable Date selectTime1,
            @PathVariable Date selectTime2,
            @PathVariable List<String> selectDate,
            @PathVariable String orderId,
            @PathVariable String project,
            @PathVariable String userId,
            @PathVariable Integer state,
            @RequestBody FlowCard flowCard) {
        return Result.seccess(flowCardService.selectPrintFlowCardSv(selectTime1, selectTime2, orderId, project,userId, flowCard));
        return Result.success(flowCardService.selectPrintFlowCardSv(selectDate, orderId, project,userId,state, flowCard));
    }
    @ApiOperation("流程卡明细查询接口")
@@ -176,43 +188,46 @@
    public Result selectPrint(
            @PathVariable String inquiryMode,
            @RequestBody Map<String, Object> object) {
        return Result.seccess(flowCardService.selectPrintSv(object,inquiryMode));
        return Result.success(flowCardService.selectPrintSv(object,inquiryMode));
    }
    @ApiOperation("打印流程卡数据查询接口")
    @PostMapping("/getSelectPrinting/{printMerge}/{printLike}/{merge}")
    @PostMapping("/getSelectPrinting/{printMerge}/{printLike}/{merge}/{flashback}/{compound}/{landingSequence}")
    public Result getSelectPrinting(
            @PathVariable String printMerge,
            @PathVariable String printLike,
            @PathVariable String merge,
            @PathVariable String flashback,
            @PathVariable String compound,
            @PathVariable String landingSequence,
            @RequestBody Map<String, Object> object) {
        return Result.seccess(flowCardService.getSelectPrintingSv(object,printMerge,printLike,merge));
        return Result.success(flowCardService.getSelectPrintingSv(object,printMerge,printLike,merge,flashback,compound,landingSequence));
    }
    @ApiOperation("工程打印流程卡数据查询接口")
    @PostMapping("/getSelectPrintProject/{printProject}/{merge}")
    @PostMapping("/getSelectPrintProject/{printProject}/{merge}/{flashback}/{landingSequence}")
    public Result getSelectPrintProject(
            @PathVariable String printProject,@PathVariable String merge) {
        return Result.seccess(flowCardService.getSelectPrintProject(printProject,merge));
            @PathVariable String printProject,@PathVariable String merge,@PathVariable String flashback,@PathVariable String landingSequence) {
        return Result.success(flowCardService.getSelectPrintProject(printProject,merge,flashback,landingSequence));
    }
    @ApiOperation("打印标签数据查询接口")
    @PostMapping("/getSelectPrintLabel/{projectNo}/{type}")
    public Result getSelectPrintLabel(@PathVariable String projectNo,@PathVariable String type) {
        return Result.seccess(flowCardService.getSelectPrintLabelSv(projectNo,type));
        return Result.success(flowCardService.getSelectPrintLabelSv(projectNo,type));
    }
    @ApiOperation("打印标签查询接口")
    @PostMapping("/getSelectPrintLabel1")
    public Result getSelectPrintLabel1(@RequestBody Map<String, Object> object) {
        return Result.seccess(flowCardService.getSelectPrintLabelSv1(object));
        return Result.success(flowCardService.getSelectPrintLabelSv1(object));
    }
    @ApiOperation("打印标签明细查询接口")
    @PostMapping("/getSelectPrintLabelDetails")
    public Result getSelectPrintLabelDetails(@RequestBody Map<String, Object> object) {
        return Result.seccess(flowCardService.getSelectPrintLabelDetails(object));
        return Result.success(flowCardService.getSelectPrintLabelDetails(object));
    }
    @ApiOperation("打印自定义标签数据查询接口明细")
@@ -220,7 +235,7 @@
    public Result getSelectPrintCustomLabel( @PathVariable String type,
                                             @PathVariable Integer lableType,
                                             @RequestBody Map<String, Object> object) {
        return Result.seccess(flowCardService.getSelectPrintCustomLabelSv(type,lableType,object));
        return Result.success(flowCardService.getSelectPrintCustomLabelSv(type,lableType,object));
    }
@@ -229,7 +244,7 @@
    public Result getSelectPrintCustomLabel2( @PathVariable String type,
                                             @PathVariable Integer lableType,
                                             @RequestBody Map<String, Object> object) {
        return Result.seccess(flowCardService.getSelectPrintCustomLabelSv2(type,lableType,object));
        return Result.success(flowCardService.getSelectPrintCustomLabelSv2(type,lableType,object));
    }
@@ -240,23 +255,32 @@
            @RequestBody Map<String, Object> object
    ) {
        return Result.seccess(flowCardService.updateComposingSv(object));
        return Result.success(flowCardService.updateComposingSv(object));
    }
    @ApiOperation("复选框撤销可排版状态")
    @SaCheckPermission("selectProcessCard.review")
    @PostMapping("/revokeComposing")
    public Result revokeComposing(
            @RequestBody Map<String, Object> object
    ) {
        return Result.success(flowCardService.revokeComposingSv(object));
    }
    @ApiOperation("流程卡打印明细数据排序查询接口")
    @PostMapping("/printFlowCardDetails/{processId}/{technologyNumber}/{process}")
    public Result printFlowCardDetails(@PathVariable String processId,
                                       @PathVariable String technologyNumber,
                                       @PathVariable String process,
                                       @RequestBody FlowCard flowCard) {
        return Result.seccess(flowCardService.printFlowCardDetailsSv(processId, technologyNumber,process, flowCard));
        return Result.success(flowCardService.printFlowCardDetailsSv(processId, technologyNumber,process, flowCard));
    }
    @ApiOperation("保存打印排序接口")
    @PostMapping("/printSort")
    public Result printSort(@RequestBody Map<String, Object> object) {
        if (flowCardService.printSortSv(object)) {
            return Result.seccess();
            return Result.success();
        } else {
            throw new ServiceException(Constants.Code_500, "保存失败");
@@ -270,17 +294,16 @@
            @PathVariable String form,
            @PathVariable String id,
            @RequestBody FlowCard flowCard) {
        return Result.seccess(flowCardService.getCustomLabelDetailSv(name,form,id, flowCard));
        return Result.success(flowCardService.getCustomLabelDetailSv(name,form,id, flowCard));
    }
    @ApiOperation("工程打印查询接口")
    @SaCheckPermission("selectPrintFlowCard.search")
    @PostMapping("/selectPrintPrintProject/{selectTime1}/{selectTime2}")
    @PostMapping("/selectPrintPrintProject/{selectDate}")
    public Result selectPrintFlowCard(
            @PathVariable Date selectTime1,
            @PathVariable Date selectTime2) {
        return Result.seccess(flowCardService.selectPrintFlowCard(selectTime1, selectTime2));
            @PathVariable List<String> selectDate) {
        return Result.success(flowCardService.selectPrintFlowCard(selectDate));
    }
    @ApiOperation("修改是否打印状态")
@@ -290,21 +313,21 @@
            @RequestBody Map<String, Object> object
    ) {
        return Result.seccess(flowCardService.updatePrintStateSv(printState,object));
        return Result.success(flowCardService.updatePrintStateSv(printState,object));
    }
    @ApiOperation("流程卡打印订单数据排序查询接口")
    @PostMapping("/printFlowCardOrderSort/{orderId}")
    public Result printFlowCardOrderSort(@PathVariable String orderId,
                                       @RequestBody FlowCard flowCard) {
        return Result.seccess(flowCardService.printFlowCardOrderSortSv(orderId, flowCard));
        return Result.success(flowCardService.printFlowCardOrderSortSv(orderId, flowCard));
    }
    @ApiOperation("保存打印订单排序接口")
    @PostMapping("/printOrderSort")
    public Result printOrderSort(@RequestBody Map<String, Object> object) {
        if (flowCardService.printOrderSort(object)) {
            return Result.seccess();
            return Result.success();
        } else {
            throw new ServiceException(Constants.Code_500, "保存失败");
@@ -318,7 +341,17 @@
            @PathVariable String printLike,
            @PathVariable String mergeTechnologyNumber,
            @RequestBody Map<String, Object> object) {
        return Result.seccess(flowCardService.getSelectPrintingRefundSv(object,printMerge,printLike,mergeTechnologyNumber));
        return Result.success(flowCardService.getSelectPrintingRefundSv(object,printMerge,printLike,mergeTechnologyNumber));
    }
    @ApiOperation("合并打印流程卡补片数据查询接口")
    @PostMapping("/getSelectPrintingConsolidated/{printMerge}/{printLike}/{mergeTechnologyNumber}")
    public Result getSelectPrintingConsolidated(
            @PathVariable String printMerge,
            @PathVariable String printLike,
            @PathVariable String mergeTechnologyNumber,
            @RequestBody Map<String, Object> object) {
        return Result.success(flowCardService.getSelectPrintingConsolidatedSv(object,printMerge,printLike,mergeTechnologyNumber));
    }
    @ApiOperation("打印流程卡返工数据查询接口")
@@ -327,7 +360,7 @@
            @PathVariable String printMerge,
            @PathVariable String printLike,
            @RequestBody Map<String, Object> object) {
        return Result.seccess(flowCardService.getSelectPrinReworkSv(object,printMerge,printLike));
        return Result.success(flowCardService.getSelectPrinReworkSv(object,printMerge,printLike));
    }
    @ApiOperation("流程卡明细按编号查询接口")
@@ -336,7 +369,7 @@
            @PathVariable String inquiryMode,
            @PathVariable Integer type,
            @RequestBody Map<String, Object> object) {
        return Result.seccess(flowCardService.selectPrintDetailsSv(object,inquiryMode,type));
        return Result.success(flowCardService.selectPrintDetailsSv(object,inquiryMode,type));
    }
@@ -345,7 +378,7 @@
    public Result getSelectPrintCustomLabelDetails( @PathVariable String type,
                                             @PathVariable Integer lableType,
                                             @RequestBody Map<String, Object> object) {
        return Result.seccess(flowCardService.getSelectPrintCustomLabelDetailsSv(type,lableType,object));
        return Result.success(flowCardService.getSelectPrintCustomLabelDetailsSv(type,lableType,object));
    }
@@ -353,7 +386,7 @@
    @PostMapping("/getPrintCustomDataProjectNo/{type}/{projectNo}")
    public Result getPrintCustomDataProjectNo( @PathVariable String type,
                                                    @PathVariable String projectNo) {
        return Result.seccess(flowCardService.getPrintCustomDataProjectNo(type,projectNo));
        return Result.success(flowCardService.getPrintCustomDataProjectNo(type,projectNo));
    }
@@ -361,18 +394,25 @@
    @PostMapping("/selectSortTable")
    public Result selectSortTable(
                                  @RequestBody Map<String, Object> object) {
        return Result.seccess(flowCardService.selectSortTableSv(object));
        return Result.success(flowCardService.selectSortTableSv(object));
    }
    @ApiOperation("合并流程卡接口")
    @PostMapping("/mergeFlowCard")
    public Result mergeFlowCard(@RequestBody Map<String, Object> object) {
        return Result.seccess(flowCardService.mergeFlowCard(object));
    @PostMapping("/mergeFlowCard/{merge}")
    public Result mergeFlowCard(@RequestBody Map<String, Object> object,
                                @PathVariable Integer merge) {
        return Result.success(flowCardService.mergeFlowCard(object,merge));
    }
    @ApiOperation("汉玻获取流程卡接口")
    @PostMapping("/getProcessCardList/hanbo")
    public Result getProcessCard(@RequestBody Map<String,String> processCards)  {
        return Result.seccess(flowCardService.getProcessCard(processCards));
        return Result.success(flowCardService.getProcessCard(processCards));
    }
    @ApiOperation("获取流程卡接口")
    @PostMapping("/getProcessCardList/all")
    public Result getProcessCardAll(@RequestBody Map<String,String> processCards)  {
        return Result.success(flowCardService.getProcessCardAll(processCards));
    }
    @ApiOperation("复选框删除流程卡")
@@ -382,68 +422,131 @@
            @RequestBody Map<String, Object> object
    ) {
        return Result.seccess(flowCardService.checkboxDeleteSv(object));
        return Result.success(flowCardService.checkboxDeleteSv(object));
    }
    @ApiOperation("工程明细打印查询")
    @PostMapping("/selectPrintProjectDetails/{projectNo}")
    public Result selectPrintProjectDetails(
                                               @PathVariable String projectNo) {
        return Result.seccess(flowCardService.getPrintProjectDetails(projectNo));
    public Result selectPrintProjectDetails( @PathVariable String projectNo) {
        return Result.success(flowCardService.getPrintProjectDetails(projectNo));
    }
    @ApiOperation("工程明细小片打印查询")
    @PostMapping("/selectPrintProjectDetailSmallPiece")
    public Result selectPrintProjectDetailSmallPiece(
            @RequestBody Map<String, Object> object) throws JsonProcessingException {
        return Result.success(flowCardService.selectPrintProjectDetailSmallPiece(object));
    }
    @ApiOperation("工程明细打印标签查询")
    @PostMapping("/getPrintCustomDataProjectNoDetail/{type}/{detailType}")
    public Result getPrintCustomDataProjectNoDetail(
            @PathVariable String type,
            @PathVariable Integer detailType,
            @RequestBody Map<String, Object> object) {
        return Result.seccess(flowCardService.getPrintCustomDataProjectNoDetailSv(type,detailType,object));
        return Result.success(flowCardService.getPrintCustomDataProjectNoDetailSv(type,detailType,object));
    }
    @ApiOperation("获取最报工新工序")
    @PostMapping("/getNewProcess/{processId}/{orderNumber}/{technologyNumber}/{orderProcess}")
    public Result getNewProcess(@PathVariable String processId,
                                @PathVariable String orderNumber,
                                @PathVariable String technologyNumber,
                                @PathVariable List<String> orderProcess){
        return Result.success(flowCardService.getNewProcessSv(processId,orderNumber,technologyNumber,orderProcess));
    }
    @ApiOperation("修改工艺流程")
    @PostMapping("/updateProcess/{processId}/{technologyNumber}/{orderId}/{process}")
    @PostMapping("/updateProcess/{processId}/{orderNumber}/{technologyNumber}/{orderId}/{process}")
    public Result updateProcess(
            @PathVariable String processId,
            @PathVariable String orderNumber,
            @PathVariable String technologyNumber,
            @PathVariable String orderId,
            @PathVariable String process,
            @RequestBody Map<String, Object> object
    ) {
        return Result.seccess(flowCardService.updateProcessSv(processId,technologyNumber,orderId,process,object));
        return Result.success(flowCardService.updateProcessSv(processId,orderNumber,technologyNumber,orderId,process,object));
    }
    @ApiOperation("工程打印标签次数修改")
    @PostMapping("/updateProjectLabelPrintCount/{projectNo}")
    public Result updateProjectLabelPrintCount(@PathVariable String projectNo){
        return Result.seccess(flowCardService.updateProjectLabelPrintCount(projectNo));
        return Result.success(flowCardService.updateProjectLabelPrintCount(projectNo));
    }
    @ApiOperation("工程打印标签次数修改")
    @PostMapping("/updateProjectProcessPrintCount/{projectNo}")
    public Result updateProjectProcessPrintCount(@PathVariable String projectNo){
        return Result.seccess(flowCardService.updateProjectProcessPrintCount(projectNo));
        return Result.success(flowCardService.updateProjectProcessPrintCount(projectNo));
    }
    @ApiOperation("流程卡合架")
    @PostMapping("/flowCardDetail")
    public Result flowCardDetail(
            @RequestBody Map<String, Object> object) {
        return Result.seccess(flowCardService.flowCardDetail(object));
        return Result.success(flowCardService.flowCardDetail(object));
    }
    @ApiOperation("保存流程卡合架")
    @PostMapping("/updateProcessCardRack")
    public Result updateProcessCardRack(
            @RequestBody Map<String, Object> object) {
        return Result.seccess(flowCardService.updateProcessCardRack(object));
        return Result.success(flowCardService.updateProcessCardRack(object));
    }
    @ApiOperation("智能分架")
    @PostMapping("/processCardAutoRack")
    public Result processCardAutoRack(@ RequestBody Map<String, Object> object) {
        return Result.seccess(flowCardService.processCardAutoRack(object));
        return Result.success(flowCardService.processCardAutoRack(object));
    }
    @ApiOperation("流程卡查询导出")
    @PostMapping("/exportDateProcess")
    public void exportDateProcess(HttpServletResponse response,
                                 @RequestBody Map<String, Object> dates
    ) throws IOException, IllegalAccessException, InstantiationException {
        //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字
        DownExcel.download(response, FlowCardDTO.class, flowCardService.exportDateProcessSv(dates), "DateProcess");
    }
    @ApiOperation("修改生产终止数量")
    @PostMapping("/updateTermination/{processId}/{orderNumber}/{value}")
    public Result updateTermination(
            @PathVariable String processId,
            @PathVariable Integer orderNumber,
            @PathVariable Integer value
    ) {
        return Result.success(flowCardService.updateTerminationSv(processId,orderNumber,value));
    }
    @ApiOperation("取消终止")
    @PostMapping("/updateTerminationNo/{processId}/{orderNumber}")
    public Result updateTerminationNo(
            @PathVariable String processId,
            @PathVariable Integer orderNumber) {
        return Result.success(flowCardService.updateTerminationNoSv(processId,orderNumber));
    }
    @ApiOperation("查询用于修改生产终止数量的完工数量")
    @PostMapping("/selectCompleted/{processId}/{orderNumber}/{process}")
    public Result selectCompleted(
            @PathVariable String processId,
            @PathVariable Integer orderNumber,
            @PathVariable String process) {
        return Result.success(flowCardService.selectCompletedSv(processId, orderNumber,process));
    }
    @ApiOperation("根据不同参数查询流程卡生产进度")
    @PostMapping("/selectProcessCardProgress")
    public Result selectProcessCardProgress(@RequestBody Map<String, String> object) {
        return flowCardService.selectProcessCardProgressSv(object);
    }
}