From 926a1e8b90381c7aa085d5462d78de9d2cc6034d Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期二, 27 二月 2024 08:58:15 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
---
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 100 insertions(+), 16 deletions(-)
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java b/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
index 07e9bf9..93efb63 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
@@ -1,46 +1,130 @@
package com.example.erp.service.pp;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.sd.Order;
import com.example.erp.entity.sd.OrderDetail;
+import com.example.erp.entity.sd.OrderGlassDetail;
import com.example.erp.mapper.pp.FlowCardMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.sql.Date;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
@Service
@DS("pp")
public class FlowCardService {
@Autowired
- FlowCardMapper flowCardMapper;
+ FlowCardMapper flowCardMapper;
- public Map<String, Object> selectProcessCard(Date selectTime1, Date selectTime2, FlowCard flowCard) {
+ //娴佺▼鍗$鐞嗘煡璇�
+ public Map<String, Object> selectProcessCard(Date selectTime1, Date selectTime2, FlowCard flowCard) {
Map<String, Object> map = new HashMap<>();
- System.out.println(flowCardMapper.selectFlowCard( selectTime1,selectTime2, flowCard));
- map.put("data", flowCardMapper.selectFlowCard( selectTime1,selectTime2, flowCard));
- // map.put("total", productMapper.getPageTotal(offset, pageSize, glassTypeId, product));
+ //System.out.println(flowCardMapper.selectFlowCard( selectTime1,selectTime2, flowCard));
+ map.put("data", flowCardMapper.selectFlowCard(selectTime1, selectTime2, flowCard));
+ return map;
+ }
+
+ //鍒嗘灦鏌ヨ
+ public Map<String, Object> selectAddProcess(Date selectTime1, Date selectTime2, FlowCard flowCard) {
+ Map<String, Object> map = new HashMap<>();
+ map.put("data", flowCardMapper.selectFlowCardMp(selectTime1, selectTime2, flowCard));
+ return map;
+ }
+
+ //鍒嗘灦鏄庣粏鏌ヨ
+ public Map<String, Object> DetailsSelectSv(String orderId, FlowCard flowCard) {
+ Map<String, Object> map = new HashMap<>();
+ map.put("data", flowCardMapper.DetailsSelectMp(orderId, flowCard));
+ return map;
+ }
+
+ //鍒犻櫎宸ュ崟
+ public Boolean DeleteFlowCardSv(String orderId, String processId) {
+ if (!orderId.isEmpty() && !processId.isEmpty()) {
+ Integer count=flowCardMapper.ReportingWorkCount(processId);
+ if (count==0){
+ //淇敼鍒嗘灦鐘舵��
+ flowCardMapper.UpdateDeleteState(orderId, processId);
+ //鍒犻櫎鍒嗘灦鏄庣粏
+ flowCardMapper.DeleteFlowCardMp(orderId, processId);
+ return true;
+ }
+ else {
+ return false;
+ }
+
+ } else {
+ return false;
+ }
+ }
+
+ //鍒嗘灦鏂板鏄庣粏鏌ヨ
+ public Map<String, Object> SelectNoCardSv(String orderId, String productionId, FlowCard flowCard) {
+ Map<String, Object> map = new HashMap<>();
+ map.put("data", flowCardMapper.SelectNoCardMp(orderId, productionId, flowCard));
return map;
}
- public Map<String, Object> selectAddProcess(Date selectTime1, Date selectTime2, Order order) {
- Map<String, Object> map = new HashMap<>();
- System.out.println(flowCardMapper.selectFlowCardMp( selectTime1,selectTime2, order));
- map.put("data", flowCardMapper.selectFlowCardMp( selectTime1,selectTime2, order));
- // map.put("total", productMapper.getPageTotal(offset, pageSize, glassTypeId, product));
- return map;
+ //淇敼鎺掔増鐘舵��
+ public Boolean UpdateLayoutStatusSv(String processId) {
+
+ if (!processId.isEmpty()) {
+ Integer Status = flowCardMapper.SelectLayoutStatus(processId);
+ if (Status == 1) {
+ flowCardMapper.UpdateLayoutStatusMp(processId);
+ } else {
+ return false;
+ }
+
+ return true;
+ } else {
+ return false;
+ }
}
- public Map<String, Object> DetailsSelectSv(String orderId, OrderDetail orderDetail) {
- Map<String, Object> map = new HashMap<>();
- map.put("data", flowCardMapper.DetailsSelectMp( orderId, orderDetail));
+ public Boolean AddFlowCardSv(Map<String, Object> object) {
+ String userName = "";
+ if (object.get("userName") != null) {
+ userName = object.get("userName").toString();
+ }
- // map.put("total", productMapper.getPageTotal(offset, pageSize, glassTypeId, product));
- return map;
+ String productionId = "";
+ if (object.get("productionId") != null) {
+ productionId = object.get("productionId").toString();
+ }
+
+ List<FlowCard> FlowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("flowCard")), FlowCard.class);
+ if (!FlowCardList.isEmpty()) {
+ for (FlowCard flowCard : FlowCardList) {
+ //娣诲姞娴佺▼鍗℃暟鎹�
+ flowCardMapper.AddFlowCardMp(flowCard.getProcessId(),flowCard.getOrderNumber(),flowCard.getLandingSequence(),flowCard.getQuantity(),productionId,userName);
+ //淇敼鍒嗘灦鐘舵�侊紝灏嗙姸鎬佹敼涓�1
+ flowCardMapper.UpdateFlowState(productionId,flowCard.getOrderNumber());
+ //鏌ヨ璇ヨ鍗曟湭鍒嗘灦鏁伴噺
+ Integer FlowCount= flowCardMapper.SelectFlowCount(productionId);
+
+ if (FlowCount==0){
+ //淇敼璁㈠崟琛ㄥ垎鏋剁姸鎬佷负2
+ System.out.println("鎴戞潵璇曡瘯1");
+ flowCardMapper.UpdateProcessingCard(productionId,2);
+ }
+ else{
+ //淇敼璁㈠崟琛ㄥ垎鏋剁姸鎬佷负1,鏈叏閮ㄥ垎鏋跺畬鎴�
+ System.out.println("鎴戞潵璇曡瘯2");
+ flowCardMapper.UpdateProcessingCard(productionId,1);
+ }
+ }
+ return true;
+ } else {
+ return false;
+ }
}
}
--
Gitblit v1.8.0