|
@@ -16,6 +16,7 @@ import com.pj.api.wx.bo.MsgDataBO;
|
|
|
import com.pj.api.wx.service.WxService;
|
|
|
import com.pj.current.config.MyConfig;
|
|
|
import com.pj.current.config.WxConfig;
|
|
|
+import com.pj.current.task.TaskService;
|
|
|
import com.pj.project.tb_business.TbBusiness;
|
|
|
import com.pj.project.tb_business.TbBusinessService;
|
|
|
import com.pj.project4sp.admin.SpAdmin;
|
|
@@ -58,23 +59,30 @@ public class TbBusinessItemService extends ServiceImpl<TbBusinessItemMapper, TbB
|
|
|
@Resource
|
|
|
@Lazy
|
|
|
private WxService wxService;
|
|
|
+ @Resource
|
|
|
+ TaskService taskService;
|
|
|
|
|
|
- /** 增 */
|
|
|
- int add(TbBusinessItem t){
|
|
|
- return tbBusinessItemMapper.add(t);
|
|
|
- }
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 增
|
|
|
+ */
|
|
|
+ int add(TbBusinessItem t) {
|
|
|
+ return tbBusinessItemMapper.add(t);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- /** 改 */
|
|
|
- int update(TbBusinessItem t){
|
|
|
- return tbBusinessItemMapper.update(t);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 改
|
|
|
+ */
|
|
|
+ int update(TbBusinessItem t) {
|
|
|
+ return tbBusinessItemMapper.update(t);
|
|
|
+ }
|
|
|
|
|
|
- /** 查 */
|
|
|
- TbBusinessItem getById(String id){
|
|
|
- return tbBusinessItemMapper.getById(id);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 查
|
|
|
+ */
|
|
|
+ TbBusinessItem getById(String id) {
|
|
|
+ return tbBusinessItemMapper.getById(id);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 查集合 - 根据条件(参数为空时代表忽略指定条件)
|
|
@@ -111,28 +119,29 @@ public class TbBusinessItemService extends ServiceImpl<TbBusinessItemMapper, TbB
|
|
|
this.updateById(tbBusinessItem);
|
|
|
//todo 通知作业方
|
|
|
List<SpAdmin> spAdminList = spAdminService.findByCustomerId(tbBusinessItem.getPickCustomerId());
|
|
|
- TbBusiness tbBusiness=tbBusinessService.getById(tbBusinessItem.getBusinessId());
|
|
|
- MsgDataBO msgDataBO = new MsgDataBO("订单号:"+tbBusinessItem.getNo(), "系统管理人员", DateUtil.now(), tbBusiness.getGoodsName()+"("+tbBusinessItem.getItemTypeName()+tbBusinessItem.getItemName()+")");
|
|
|
+ TbBusiness tbBusiness = tbBusinessService.getById(tbBusinessItem.getBusinessId());
|
|
|
+ taskService.addTask(new PayTask(tbBusiness.getId(), 10,tbBusiness.getCustomerId()));
|
|
|
+ MsgDataBO msgDataBO = new MsgDataBO("订单号:" + tbBusinessItem.getNo(), "系统管理人员", DateUtil.now(), tbBusiness.getGoodsName() + "(" + tbBusinessItem.getItemTypeName() + tbBusinessItem.getItemName() + ")");
|
|
|
spAdminList.stream().filter(admin -> StrUtil.isNotEmpty(admin.getOpenid())).forEach(admin -> {
|
|
|
- String detailUrl = myConfig.getWebDomain() + "/pages/business-item/item-detail?itemId=" + id+"&openid="+admin.getOpenid();
|
|
|
+ String detailUrl = myConfig.getWebDomain() + "/pages/business-item/item-detail?itemId=" + id + "&openid=" + admin.getOpenid();
|
|
|
wxService.sendTemplateMsg(wxConfig.getBusinessConfirmTemplate(), admin.getOpenid(), msgDataBO, detailUrl);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
public String exportItems(String beginTime, String endTime) {
|
|
|
SoMap so = SoMap.getRequestSoMap();
|
|
|
- so.put("typeFlag",1);
|
|
|
+ so.put("typeFlag", 1);
|
|
|
so.put("beginTime", beginTime);
|
|
|
so.put("endTime", endTime);
|
|
|
List<TbBusinessItem> itemList = this.getList(so);
|
|
|
List<ExportItemsDTO> itemDTOList = new ArrayList<>();
|
|
|
for (TbBusinessItem item : itemList) {
|
|
|
ExportItemsDTO itemsDTO = new ExportItemsDTO();
|
|
|
- BeanUtil.copyProperties(item, itemsDTO,"createTime", "pickTime", "confirmTime");
|
|
|
+ BeanUtil.copyProperties(item, itemsDTO, "createTime", "pickTime", "confirmTime");
|
|
|
itemsDTO.setUnit(item.getItemPrice() + item.getUnit())
|
|
|
- .setCreateTime(DateUtil.format(item.getCreateTime(), "yyyy/MM/dd HH:mm:ss"))
|
|
|
- .setPickTime(DateUtil.format(item.getPickTime(), "yyyy/MM/dd HH:mm:ss"))
|
|
|
- .setConfirmTime(DateUtil.format(item.getConfirmTime(), "yyyy/MM/dd HH:mm:ss"));
|
|
|
+ .setCreateTime(DateUtil.format(item.getCreateTime(), "yyyy/MM/dd HH:mm:ss"))
|
|
|
+ .setPickTime(DateUtil.format(item.getPickTime(), "yyyy/MM/dd HH:mm:ss"))
|
|
|
+ .setConfirmTime(DateUtil.format(item.getConfirmTime(), "yyyy/MM/dd HH:mm:ss"));
|
|
|
itemDTOList.add(itemsDTO);
|
|
|
}
|
|
|
String separator = File.separator;
|
|
@@ -146,7 +155,7 @@ public class TbBusinessItemService extends ServiceImpl<TbBusinessItemMapper, TbB
|
|
|
if (!saveFIle.exists()) {
|
|
|
saveFIle.mkdirs();
|
|
|
}
|
|
|
- EasyExcel.write(savePath+fileName, ExportItemsDTO.class).sheet("作业订单").doWrite(itemDTOList);
|
|
|
+ EasyExcel.write(savePath + fileName, ExportItemsDTO.class).sheet("作业订单").doWrite(itemDTOList);
|
|
|
return prefix + "/businessItem/" + today + "/items_" + beginTime + "--" + endTime + ".xlsx";
|
|
|
}
|
|
|
}
|