chenlu
6 天以前 d5055b7870d0406f9b00d429cb47d2bfb79b902c
north-glass-erp/src/main/java/com/example/erp/controller/pp/ReplenishController.java
@@ -3,18 +3,26 @@
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.example.erp.common.Constants;
import com.example.erp.common.Result;
import com.example.erp.dto.pp.PatchLogAddDTO;
import com.example.erp.dto.pp.PatchLogDTO;
import com.example.erp.dto.pp.TeamOutputDTO;
import com.example.erp.dto.pp.exportReplenishDTO;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.pp.PatchLog;
import com.example.erp.entity.pp.Rework;
import com.example.erp.exception.ServiceException;
import com.example.erp.service.pp.ReplenishService;
import com.example.erp.service.pp.ReworkService;
import com.example.erp.tools.DownExcel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.Date;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
@@ -30,42 +38,83 @@
    /*发货订单查询*/
    @ApiOperation("补片新增查询接口")
    @SaCheckPermission("AddReplenish.search")
    @SaCheckPermission("addReplenish.search")
    @PostMapping("/getSelectReplenish/{pageNum}/{pageSize}")
    public Result getSelectReplenish(@PathVariable Integer pageNum, @PathVariable Integer pageSize){
        return Result.seccess(replenishService.getSelectReplenish(pageNum,pageSize));
    public Result getSelectReplenish(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@RequestBody PatchLogAddDTO patchLogAddDTO){
        return Result.success(replenishService.getSelectReplenish(pageNum,pageSize,patchLogAddDTO));
    }
    @ApiOperation("补片查询接口")
    @SaCheckPermission("SelectReplenish.search")
    @SaCheckPermission("selectReplenish.search")
    @PostMapping("/SelectReplenish/{pageNum}/{pageSize}/{selectDate}")
    public Result SelectReplenish(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate,@RequestBody PatchLog patchLog){
        return Result.seccess(replenishService.SelectReplenish(pageNum,pageSize,selectDate,patchLog));
    public Result SelectReplenish(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate,@RequestBody PatchLogDTO patchLogDTO){
        return Result.success(replenishService.SelectReplenish(pageNum,pageSize,selectDate,patchLogDTO));
    }
    @ApiOperation("补片新增接口")
    @SaCheckPermission("AddReplenish.add")
    @SaCheckPermission("addReplenish.add")
    @PostMapping("/saveReplenish")
    public Result updateFinishedGoodsInventoryAllocate( @RequestBody Map<String,Object> object){
        return Result.seccess(replenishService.saveReplenish(object));
        return Result.success(replenishService.saveReplenish(object));
    }
    @ApiOperation("补片审核接口")
    @SaCheckPermission("SelectReplenish.review")
    @SaCheckPermission("selectReplenish.review")
    @PostMapping("/updateReplenish")
    public Result updateReplenish( @RequestBody Map<String,Object> object){
        return Result.seccess(replenishService.updateReplenish(object));
        return Result.success(replenishService.updateReplenish(object));
    }
    @ApiOperation("流程卡补片打印查询接口")
    @PostMapping("/selectReplenishPrintFlowCard/{selectTime1}/{selectTime2}/{orderId}/{project}")
    public Result selectReplenishPrintFlowCard(
    @ApiOperation("补片流程卡明细查询接口")
    @SaCheckPermission("printReplenishFlowCard.search")
    @PostMapping("/selectPrint/{selectTime1}/{selectTime2}")
    public Result selectPrint(
            @PathVariable Date selectTime1,
            @PathVariable Date selectTime2,
            @PathVariable String orderId,
            @PathVariable String project,
            @RequestBody FlowCard flowCard) {
        return Result.seccess(replenishService.selectReplenishPrintFlowCardSv(selectTime1, selectTime2, orderId, project, flowCard));
        return Result.success(replenishService.selectPrintSv(selectTime1,selectTime2, flowCard));
    }
    @ApiOperation("补片打印自定义标签数据查询接口")
    @PostMapping("/getSelectPrintCustomLabel/{type}/{lableType}")
    public Result getSelectPrintCustomLabel( @PathVariable String type,
                                             @PathVariable Integer lableType,
                                             @RequestBody Map<String, Object> object) {
        return Result.success(replenishService.getSelectPrintCustomLabelSv(type,lableType,object));
    }
    @ApiOperation("补片删除接口")
    @SaCheckPermission("selectReplenish.delete")
    @PostMapping("/deleteReplenish")
    public Result deleteReplenish( @RequestBody Map<String,Object> object){
        return Result.success(replenishService.deleteReplenishSv(object));
    }
    @ApiOperation("补片反审接口")
    @SaCheckPermission("selectReplenish.countertrial")
    @PostMapping("/updateCancelReview")
    public Result updateCancelReview( @RequestBody Map<String,Object> object){
        return Result.success(replenishService.updateCancelReviewSv(object));
    }
    @ApiOperation("补片信息导出")
    @PostMapping("/exportReplenish")
    public void exportReplenish(HttpServletResponse response,
                                 @RequestBody List<LocalDate> dates
    ) throws IOException, IllegalAccessException, InstantiationException {
        //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字
        DownExcel.download(response, exportReplenishDTO.class, replenishService.exportReplenishSv(dates), "PatchLogAddDTO");
    }
    @ApiOperation("修改打印次数")
    @PostMapping("/updatePrintNum")
    public Result updatePrintNum(
            @RequestBody List<Map<String, Object>> object
    ) {
        return Result.success(replenishService.updatePrintNumSv(object));
    }
}