|
@@ -27,6 +27,7 @@ import com.fjhx.common.entity.contract.po.ContractTemplate;
|
|
|
import com.fjhx.common.entity.corporation.po.Corporation;
|
|
|
import com.fjhx.common.entity.documentary.bo.DocumentaryData;
|
|
|
import com.fjhx.common.enums.FlowStatusEnum1;
|
|
|
+import com.fjhx.common.enums.PushBusinessTypeEnum;
|
|
|
import com.fjhx.common.service.contract.ContractTemplateService;
|
|
|
import com.fjhx.common.service.corporation.CorporationService;
|
|
|
import com.fjhx.common.service.documentary.GetDocumentaryBusinessTemplate;
|
|
@@ -73,10 +74,13 @@ import com.fjhx.sale.service.claim.ClaimContractService;
|
|
|
import com.fjhx.sale.service.contract.*;
|
|
|
import com.fjhx.sale.service.purchase.EhsdPurchaseProductService;
|
|
|
import com.fjhx.sale.service.purchase.EhsdPurchaseService;
|
|
|
+import com.fjhx.socket.core.PushTypeEnum;
|
|
|
+import com.fjhx.socket.core.WebSocketPush;
|
|
|
import com.fjhx.supply.service.supplier.SupplierInfoService;
|
|
|
import com.fjhx.tenant.entity.dict.dto.DictTenantDataSelectDto;
|
|
|
import com.fjhx.tenant.entity.dict.vo.DictTenantDataVo;
|
|
|
import com.fjhx.tenant.service.dict.DictTenantDataService;
|
|
|
+import com.fjhx.tenant.utils.DictUtils;
|
|
|
import com.ruoyi.common.annotation.TenantIgnore;
|
|
|
import com.ruoyi.common.core.domain.BaseIdPo;
|
|
|
import com.ruoyi.common.core.domain.BasePo;
|
|
@@ -100,6 +104,7 @@ import org.springframework.security.core.context.SecurityContext;
|
|
|
import org.springframework.security.core.context.SecurityContextHolder;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
@@ -2685,4 +2690,41 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
return reData;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 修改合同生产标签
|
|
|
+ */
|
|
|
+ @DSTransactional
|
|
|
+ @Override
|
|
|
+ public void updateProductionTag(@RequestBody ContractDto dto) {
|
|
|
+ Contract contract = this.getById(dto.getId());
|
|
|
+ if (ObjectUtil.isEmpty(contract)) {
|
|
|
+ throw new ServiceException("查询不到合同信息!");
|
|
|
+ }
|
|
|
+ this.update(q -> q
|
|
|
+ .eq(Contract::getId, dto.getId())
|
|
|
+ .set(Contract::getProdTag, dto.getProdTag())
|
|
|
+ .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
|
|
|
+ .set(BasePo::getUpdateTime, new Date())
|
|
|
+ );
|
|
|
+
|
|
|
+ Map<String, String> dictMap = DictUtils.getDictMap("contract_prod_tag");
|
|
|
+ String prodTag = contract.getProdTag();
|
|
|
+ prodTag = ObjectUtil.isEmpty(prodTag) ? "" : prodTag;
|
|
|
+ String[] split = prodTag.split(",");
|
|
|
+ List<String> arr = new ArrayList<>();
|
|
|
+ for (String s : split) {
|
|
|
+ String s1 = dictMap.get(s);
|
|
|
+ if (ObjectUtil.isNotEmpty(s1)) {
|
|
|
+ arr.add(s1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String collect = arr.stream().collect(Collectors.joining(","));
|
|
|
+ //消息推送 给归属公司的 总经理
|
|
|
+ JSONObject msg = new JSONObject();
|
|
|
+ msg.put("msg", String.format("合同【%s】发生生产标签变更,变更如下:%s", contract.getCode(), collect));
|
|
|
+ msg.put("business_id", dto.getId());
|
|
|
+ List<Long> generalManagerIds = UserUtil.getUserIdsByRoleKey("general_manager", dto.getCompanyId());
|
|
|
+ WebSocketPush.byUsers(PushTypeEnum.MESSAGE, generalManagerIds, msg.toString(), PushBusinessTypeEnum.CONTRACT_PRODUCTION_TAG_UPDATE.getType());
|
|
|
+ }
|
|
|
+
|
|
|
}
|