|
@@ -4,13 +4,11 @@ import com.steerinfo.dil.mapper.DilNoticeMapper;
|
|
|
import com.steerinfo.dil.model.DilNotice;
|
|
|
import com.steerinfo.dil.service.IDilNoticeService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
+import java.util.*;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* DilNotice服务实现:
|
|
@@ -335,4 +333,28 @@ public class DilNoticeServiceImpl implements IDilNoticeService {
|
|
|
public List<Map<String, Object>> getNoticeUser(Map<String, Object> mapValue) {
|
|
|
return dilNoticeMapper.getNoticeUser(mapValue);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询国内矿采购订单是否符合标准,若不符合则发送给自动化部负责人:(UserId:1012690778083954688)
|
|
|
+ */
|
|
|
+ @Scheduled(fixedRate = 1000*60*60)
|
|
|
+ public void checkPurchaseOrder(){
|
|
|
+ List<Map<String,Object>> purchaseOrders=dilNoticeMapper.findErrorOrder();
|
|
|
+ for(Map<String,Object> item:purchaseOrders){
|
|
|
+ //插入通知表
|
|
|
+ DilNotice notice=new DilNotice();
|
|
|
+ notice.setNoticeId(dilNoticeMapper.selectNoticeId());
|
|
|
+ notice.setNoticeTitle(item.get("purchaseOrderNo")+"订单异常");
|
|
|
+ notice.setNoticeContent("国内矿订单'"+item.get("purchaseOrderNo")+"'缺少发站!");
|
|
|
+ notice.setInsertTime(new Date());
|
|
|
+ notice.setInsertUsername("system");
|
|
|
+ notice.setDeleted(new BigDecimal(0));
|
|
|
+ notice.setInsertUpdateRemark(""+item.get("purchaseOrderNo"));
|
|
|
+ dilNoticeMapper.insertSelective(notice);
|
|
|
+ //插入通知子表
|
|
|
+ item.put("noticeId",notice.getNoticeId());
|
|
|
+ item.put("userId","1012690778083954688");
|
|
|
+ dilNoticeMapper.insertIntoNoticeUserToOne(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|