guoyuji
2024-07-18 09897d2adec822b398c652bc3b8e6b6cfd6a6b2b
north-glass-erp/src/main/java/com/example/erp/service/pp/ReworkService.java
@@ -4,18 +4,16 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.example.erp.entity.pp.BasicDataProduce;
import com.example.erp.entity.pp.PatchLog;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.pp.Rework;
import com.example.erp.entity.sd.Delivery;
import com.example.erp.entity.sd.OrderDetail;
import com.example.erp.entity.userInfo.SysError;
import com.example.erp.mapper.pp.BasicDateProduceMapper;
import com.example.erp.mapper.pp.ReworkMapper;
import com.example.erp.mapper.pp.*;
import com.example.erp.service.userInfo.SysErrorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import com.example.erp.mapper.pp.FlowCardMapper;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
@@ -27,12 +25,20 @@
@Transactional(rollbackFor = Exception.class)
public class ReworkService {
    @Autowired
    PatchLogMapper patchMapper;
    @Autowired
    ReworkMapper reworkMapper;
    @Autowired
    BasicDateProduceMapper basicDateProduceMapper;
    @Autowired
    SysErrorService sysErrorService;
    final
    FlowCardMapper flowCardMapper;
    public ReworkService(FlowCardMapper flowCardMapper) {
        this.flowCardMapper = flowCardMapper;
    }
    public List<Map<String, Object>> getSelectRework(Integer pageNum, Integer pageSize) {
        Integer offset = (pageNum - 1) * pageSize;
@@ -103,6 +109,7 @@
                    //添加返工记录,修改次破明细数量
                    reworkMapper.insertRework(rework,oddNumber);
                    reworkMapper.updateDamageDetails(rework);
                    patchMapper.updateReportingWorkDetail(rework.getReportingWorkId(), Integer.valueOf(rework.getOrderSort()),rework.getTechnologyNumber());
                }
            }
@@ -163,5 +170,12 @@
        String oddNumbers =  alias+formattedDate+formattedNumber;
        return oddNumbers;
    }
    public Object selectPrintSv(java.sql.Date selectTime1, java.sql.Date selectTime2, FlowCard flowCard) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", flowCardMapper.selectReworkPrintMp(selectTime1,selectTime2,flowCard));
        map.put("type", flowCardMapper.selectType());
        return map;
    }
}