| | |
| | | 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) { |
| | |
| | | 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; |
| | | } |
| | | } |
| | | } |