廖井涛
2025-03-03 aa3bd3741b94f50f0c1d7e3a137bb681d7421294
north-glass-erp/src/main/java/com/example/erp/service/pp/TagStyleService.java
@@ -1,20 +1,28 @@
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.pp.TagStyle;
import com.example.erp.mapper.pp.FlowCardMapper;
import com.example.erp.mapper.pp.TagStyleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
@DS("pp")
public class TagStyleService {
    private final TagStyleMapper tagStyleMapper;
    public TagStyleService(TagStyleMapper tagStyleMapper) {
    final
    FlowCardMapper flowCardMapper;
    public TagStyleService(TagStyleMapper tagStyleMapper, FlowCardMapper flowCardMapper) {
        this.tagStyleMapper = tagStyleMapper;
        this.flowCardMapper = flowCardMapper;
    }
    public Boolean saveTag(TagStyle tagStyle) {
@@ -47,4 +55,17 @@
        tagStyle.setId(null);
        return tagStyleMapper.insert(tagStyle)>0;
    }
    public Boolean updatePrintNumberSv(Map<String, Object> object) {
        List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("printList")), FlowCard.class);
        if (!flowCardList.isEmpty()) {
            for (FlowCard flowCard : flowCardList) {
                // 更新打印状态
                flowCardMapper.updatePrintNumberMp( flowCard.getProcessId(), flowCard.getOrderNumber());
            }
            return true;
        } else {
            return false;
        }
    }
}