|
|
@ -5,6 +5,7 @@ import cn.hutool.core.date.DateTime; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.google.common.util.concurrent.ThreadFactoryBuilder; |
|
|
|
import com.yxt.anrui.as.api.asappendix.AsAppendix; |
|
|
|
import com.yxt.anrui.as.api.asbusrepairbill.*; |
|
|
|
import com.yxt.anrui.as.api.asbusrepairbill.app.*; |
|
|
@ -52,10 +53,13 @@ import com.yxt.anrui.as.feign.file.AsFileEnum; |
|
|
|
import com.yxt.anrui.as.feign.fin.finselectedreceivablesdetailed.FinSelectedReceivablesDetailedFeign; |
|
|
|
import com.yxt.anrui.as.feign.fin.finuncollectedreceivablesdetailed.FinUncollectedReceivablesDetailedFeign; |
|
|
|
import com.yxt.anrui.as.feign.fms.FmsReceivesettleFeign; |
|
|
|
import com.yxt.anrui.as.feign.message.MessageFeign; |
|
|
|
import com.yxt.anrui.as.feign.message.PushMessageQuery; |
|
|
|
import com.yxt.anrui.as.feign.portal.privilege.PrivilegeQuery; |
|
|
|
import com.yxt.anrui.as.feign.portal.sysorganization.SysOrganizationFeign; |
|
|
|
import com.yxt.anrui.as.feign.portal.sysorganization.SysOrganizationVo; |
|
|
|
import com.yxt.anrui.as.feign.portal.sysstafforg.SysStaffOrgFeign; |
|
|
|
import com.yxt.anrui.as.feign.portal.sysuser.DeptUserVo; |
|
|
|
import com.yxt.anrui.as.feign.portal.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.as.feign.portal.sysuser.SysUserVo; |
|
|
|
import com.yxt.anrui.as.feign.sms.SmsGoods; |
|
|
@ -74,6 +78,7 @@ import com.yxt.common.core.query.PagerQuery; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.tomcat.util.threads.ThreadPoolExecutor; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
@ -87,6 +92,8 @@ import java.text.SimpleDateFormat; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.ZoneId; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: |
|
|
@ -96,6 +103,7 @@ import java.util.*; |
|
|
|
@Service |
|
|
|
public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMapper, AsBusrepairBill> { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
private AsBusrepairBillInsuranceRecordService asBusrepairBillInsuranceRecordService; |
|
|
|
@Autowired |
|
|
@ -160,7 +168,8 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
private YxtCrmCustomerTempFeign yxtCrmCustomerTempFeign; |
|
|
|
@Autowired |
|
|
|
private WmsInventoryFeign wmsInventoryFeign; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private MessageFeign messageFeign; |
|
|
|
/** |
|
|
|
* 维修领料获取派工单 |
|
|
|
* |
|
|
@ -1895,12 +1904,13 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
amount = new BigDecimal(sitemVo.getAmount()); |
|
|
|
} |
|
|
|
itemPdfVos.add(itemPdfVo); |
|
|
|
if (subject.equals("保内")) { |
|
|
|
sumMoney1.add(price); |
|
|
|
} |
|
|
|
if (subject.equals("保外")) { |
|
|
|
sumMoney1.add(amount); |
|
|
|
} |
|
|
|
// if (subject.equals("保内")) {
|
|
|
|
// sumMoney1.add(price);
|
|
|
|
// }
|
|
|
|
// if (subject.equals("保外")) {
|
|
|
|
// sumMoney1.add(amount);
|
|
|
|
// }
|
|
|
|
sumMoney1 = sumMoney1.add(amount); |
|
|
|
} |
|
|
|
vo.setItems(itemPdfVos); |
|
|
|
} |
|
|
@ -1924,13 +1934,15 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
amount = new BigDecimal(goodsDetailsVo.getAmount()); |
|
|
|
} |
|
|
|
goodsPdfVos.add(goodsPdfVo); |
|
|
|
if (subject.equals("保内")) { |
|
|
|
sumMoney2.add(price); |
|
|
|
} |
|
|
|
if (subject.equals("保外")) { |
|
|
|
sumMoney2.add(amount); |
|
|
|
} |
|
|
|
// if (subject.equals("保内")) {
|
|
|
|
// sumMoney2.add(price);
|
|
|
|
// }
|
|
|
|
// if (subject.equals("保外")) {
|
|
|
|
// sumMoney2.add(amount);
|
|
|
|
// }
|
|
|
|
sumMoney2 = sumMoney2.add(amount); |
|
|
|
} |
|
|
|
vo.setGoods(goodsPdfVos); |
|
|
|
} |
|
|
|
vo.setSumMoney2(sumMoney2.toString()); |
|
|
|
String caps2 = bigDecimalToLocalStr(sumMoney2); |
|
|
@ -2014,7 +2026,11 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
if (price0) { |
|
|
|
map.put("price", "0"); |
|
|
|
} else { |
|
|
|
map.put("price", itemPdfVo.getPrice()); |
|
|
|
if (subject.equals("保内")) { |
|
|
|
map.put("price", itemPdfVo.getAmount()); |
|
|
|
} else { |
|
|
|
map.put("price", itemPdfVo.getPrice()); |
|
|
|
} |
|
|
|
} |
|
|
|
map.put("discount", itemPdfVo.getDiscount()); |
|
|
|
map.put("discountAmount", itemPdfVo.getDiscountAmount()); |
|
|
@ -2241,6 +2257,37 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
if (null != detail) { |
|
|
|
detail.setRepairState(2); |
|
|
|
baseMapper.updateById(detail); |
|
|
|
//维修完毕后推送消息给配件管理员,完成配件出库确认
|
|
|
|
List<String> role = new ArrayList<>(); |
|
|
|
role.add("分公司配件主管"); |
|
|
|
role.add("分公司配件库管员"); |
|
|
|
List<DeptUserVo> userVos = sysUserFeign.selectByDeptSidAndRoleName(detail.getDeptSid(), role).getData(); |
|
|
|
if (!userVos.isEmpty()) { |
|
|
|
List<String> userSids = userVos.stream().map(DeptUserVo::getSid).collect(Collectors.toList()); |
|
|
|
try { |
|
|
|
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() |
|
|
|
.setNameFormat("demo-pool-%d").build(); |
|
|
|
ExecutorService pool = new ThreadPoolExecutor(1, 10, |
|
|
|
1000, TimeUnit.MILLISECONDS, |
|
|
|
new LinkedBlockingQueue<Runnable>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); |
|
|
|
Future future1 = pool.submit(() -> { |
|
|
|
PushMessageQuery pushMessageQuery = new PushMessageQuery(); |
|
|
|
pushMessageQuery.setReceivedSids(userSids); |
|
|
|
pushMessageQuery.setModuleName("售后服务"); |
|
|
|
pushMessageQuery.setMsgContent("维修单号:"+ detail.getBillNo() + "已维修完毕,请进行配件出库确认"); |
|
|
|
pushMessageQuery.setApp_type("2"); |
|
|
|
pushMessageQuery.setModuleSid("fea6ee02-05cc-11ef-9a84-8032536963eb"); |
|
|
|
pushMessageQuery.setMsgTitle("配件出库确认提醒"); |
|
|
|
pushMessageQuery.setBusinessSid(detail.getSid()); |
|
|
|
// 消息推送
|
|
|
|
messageFeign.pushNoUriMessage(pushMessageQuery); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|