Browse Source

接口开发

袁少华 4 years ago
parent
commit
6ef439dfef

+ 50 - 16
src/main/java/org/jeecg/modules/appInterface/controller/FbsWorkingStatisticsController.java

@@ -24,6 +24,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 
 import org.jeecg.modules.appInterface.service.IFbsWorkingStatisticsService;
+import org.jeecg.modules.fbsPerson.entity.FbsPerson;
+import org.jeecg.modules.fbsPerson.service.IFbsPersonService;
 import org.jeecg.modules.fbsWorkshopDispatchList.entity.FbsWorkshopDispatchList;
 import org.jeecg.modules.fbsWorkshopDispatchList.service.IFbsWorkshopDispatchListService;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
@@ -56,7 +58,8 @@ public class FbsWorkingStatisticsController {
 	private IFbsWorkingStatisticsService fbsWorkingStatisticsService;
 	 @Autowired
 	 private IFbsWorkshopDispatchListService fbsWorkshopDispatchListService;
-
+	 @Autowired
+	 private IFbsPersonService fbsPersonService;
 	 public static void main(String[] srg) {
 		 String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
 		 //加载JDBC驱动
@@ -87,7 +90,8 @@ public class FbsWorkingStatisticsController {
 	 public ResponseEntity<ResHttpStatus> startOperation(FbsWorkingStatistics entity){
 		 ResHttpStatus res = new ResHttpStatus();
 		 FbsWorkingStatistics fbsWorkingStatistics = new FbsWorkingStatistics();
-
+		 List<FbsPerson> aa = fbsPersonService.list();
+		 System.out.println(aa.size());
 		 if(entity == null){
 			 res.setCode("1");
 			 res.setMsg("参数不能为空");
@@ -113,12 +117,15 @@ public class FbsWorkingStatisticsController {
 			 res.setMsg("订单id不能为空");
 			 return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
 		 }
-		 FbsWorkshopDispatchList workshopDispatchList = fbsWorkshopDispatchListService.getById(entity.getOrderId());
-		 if(workshopDispatchList == null){
+		 QueryWrapper<FbsWorkshopDispatchList> ypffscSaleorderBQueryWrapper = new QueryWrapper<>();
+		 ypffscSaleorderBQueryWrapper.eq("productionOrderNumberId", entity.getOrderId()).eq("del_flag", 0);
+		 List<FbsWorkshopDispatchList> list = fbsWorkshopDispatchListService.list(ypffscSaleorderBQueryWrapper);
+		 if(list.size() < 1){
 			 res.setCode("1");
 			 res.setMsg("该订单还没有派工"+entity.getOrderNumber());
 			 return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
 		 }
+		 FbsWorkshopDispatchList workshopDispatchList = list.get(0);
 		 //0初始,1接单,2暂停,3完成
 		 if(StringUtils.isNotBlank(workshopDispatchList.getState()) && !workshopDispatchList.getState().equals("0") &&
                  !workshopDispatchList.getState().equals("2")){
@@ -181,12 +188,15 @@ public class FbsWorkingStatisticsController {
              res.setMsg("订单id不能为空");
              return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
          }
-         FbsWorkshopDispatchList workshopDispatchList = fbsWorkshopDispatchListService.getById(entity.getOrderId());
-         if(workshopDispatchList == null){
-             res.setCode("1");
-             res.setMsg("该订单还没有派工"+entity.getOrderNumber());
-             return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
-         }
+		 QueryWrapper<FbsWorkshopDispatchList> ypffscSaleorderBQueryWrapper = new QueryWrapper<>();
+		 ypffscSaleorderBQueryWrapper.eq("productionOrderNumberId", entity.getOrderId()).eq("del_flag", 0);
+		 List<FbsWorkshopDispatchList> list = fbsWorkshopDispatchListService.list(ypffscSaleorderBQueryWrapper);
+		 if(list.size() < 1){
+			 res.setCode("1");
+			 res.setMsg("该订单还没有派工"+entity.getOrderNumber());
+			 return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
+		 }
+		 FbsWorkshopDispatchList workshopDispatchList = list.get(0);
 
          //状态(0初始,1接单,2暂停,3完成)
          if(StringUtils.isNotBlank(workshopDispatchList.getState()) && !workshopDispatchList.getState().equals("1")){
@@ -236,6 +246,27 @@ public class FbsWorkingStatisticsController {
 			 res.setMsg("人员名称不能为空");
 			 return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
 		 }
+
+		 if(StringUtils.isBlank(entity.getQualifiedNumber())){
+			 res.setCode("1");
+			 res.setMsg("合格数量不能为空");
+			 return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
+		 }
+		 if(StringUtils.isBlank(entity.getScrapNumber())){
+			 res.setCode("1");
+			 res.setMsg("报废数量不能为空");
+			 return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
+		 }
+		 if(StringUtils.isBlank(entity.getRefuseNumber())){
+			 res.setCode("1");
+			 res.setMsg("拒绝数量不能为空");
+			 return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
+		 }
+		 if(StringUtils.isBlank(entity.getState())){
+			 res.setCode("1");
+			 res.setMsg("状态不能为空0保存,1提交");
+			 return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
+		 }
 		 if(StringUtils.isBlank(entity.getOrderNumber())){
 			 res.setCode("1");
 			 res.setMsg("订单号不能为空");
@@ -246,12 +277,15 @@ public class FbsWorkingStatisticsController {
              res.setMsg("订单id不能为空");
              return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
          }
-         FbsWorkshopDispatchList workshopDispatchList = fbsWorkshopDispatchListService.getById(entity.getOrderId());
-         if(workshopDispatchList == null){
-             res.setCode("1");
-             res.setMsg("该订单还没有派工"+entity.getOrderNumber());
-             return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
-         }
+		 QueryWrapper<FbsWorkshopDispatchList> ypffscSaleorderBQueryWrapper = new QueryWrapper<>();
+		 ypffscSaleorderBQueryWrapper.eq("productionOrderNumberId", entity.getOrderId()).eq("del_flag", 0);
+		 List<FbsWorkshopDispatchList> list = fbsWorkshopDispatchListService.list(ypffscSaleorderBQueryWrapper);
+		 if(list.size() < 1){
+			 res.setCode("1");
+			 res.setMsg("该订单还没有派工"+entity.getOrderNumber());
+			 return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
+		 }
+		 FbsWorkshopDispatchList workshopDispatchList = list.get(0);
 
          //状态(0初始,1接单,2暂停,3完成)
          if(StringUtils.isNotBlank(workshopDispatchList.getState()) && !workshopDispatchList.getState().equals("1")){

+ 19 - 0
src/main/java/org/jeecg/modules/appInterface/entity/FbsWorkingStatistics.java

@@ -78,4 +78,23 @@ public class FbsWorkingStatistics implements Serializable {
 	/**订单id*/
 	@Excel(name = "订单id", width = 15)
 	private String orderId;
+
+	/**合格数量*/
+	@Excel(name = "合格数量", width = 15)
+	private String qualifiedNumber;
+	/**报废数量 */
+	@Excel(name = "报废数量", width = 15)
+	private String scrapNumber;
+	/**报废原因*/
+	@Excel(name = "报废原因", width = 15)
+	private String scrapInfo;
+	/**拒绝数量*/
+	@Excel(name = "拒绝数量", width = 15)
+	private String refuseNumber;
+	/**拒绝原因*/
+	@Excel(name = "拒绝原因", width = 15)
+	private String refuseInfo;
+	/**0保存,1提交 */
+	@Excel(name = "0保存,1提交", width = 15)
+	private String state;
 }