| | |
| | | import com.highdatas.mdm.util.Constant;
|
| | | import com.highdatas.mdm.util.DbUtils;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.apache.commons.lang3.StringUtils;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
| | | public void run() {
|
| | | log.info("mq: {} ---------- run", mqEntity.toString());
|
| | | String type = mqEntity.getType();
|
| | | SysDispenseLogs logByMqEntity = DbUtils.dispenseLogsService.getLogByMqEntity(mqEntity);
|
| | | try{
|
| | | if (type.equalsIgnoreCase(Constant.Master)) {
|
| | | sendMasterData();
|
| | |
| | | }
|
| | | catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | //log
|
| | | if (logByMqEntity != null) {
|
| | | logByMqEntity.setErrorInfo(e.getMessage()).updateById();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | String fields = fieldByMaintain.stream().map(sysField -> sysField.getField()).collect(Collectors.joining(Constant.COMMA));
|
| | |
|
| | | String filter = DbUtils.masterAuthorService.getFilter(user, maintain.getId());
|
| | | if (StringUtils.isEmpty(filter)) {
|
| | | filter = Constant.WHERE_DEFAULT;
|
| | | }
|
| | | String content;
|
| | | if (increment) {
|
| | | String maintainTableName = maintain.getTableName();
|
| | |
| | | page.setPageSize(mqEntity.getPageSize().get());
|
| | | page.setPageNo(mqEntity.getPageNo().get());
|
| | | List<Map<String, Object>> maps = DbUtils.maintainDetailMapper.selectMaintainDetail(fields, tempTableName, maintain.getId(), filter, page.getLimitSQL());
|
| | |
|
| | | Map<String, AntianaphylaxisResult> helpfulField = DbUtils.antianaphylaxisClient.getHelpfulField(fields, maintainTableName);
|
| | | DbUtils.antianaphylaxisClient.fixMasterData(maps,helpfulField);
|
| | |
|
| | | JSONObject object = new JSONObject();
|
| | | object.fluentPut("total", page.getRecordCount());
|
| | | object.fluentPut("size", page.getPageSize());
|
| | |
| | | String size = (bytes.length / 1024) + "k";
|
| | | log.info(size);
|
| | | Date now = new Date();
|
| | |
|
| | | // String mqBody = com.datacvg.common.AESUtil.getInstance().encoder(content, mqEntity.getUserId(),"http://180.169.94.250:9107");
|
| | | String mqBody = content;
|
| | | Boolean aes = DbUtils.dispenseService.getAes();
|
| | | String mqBody;
|
| | | if (aes) {
|
| | | String aesUrl = DbUtils.dispenseService.getAesUrl();
|
| | | mqBody = com.datacvg.common.AESUtil.getInstance().encoder(content, mqEntity.getUserId(), aesUrl);
|
| | | } else {
|
| | | mqBody = content;
|
| | | }
|
| | | bytes = mqBody.getBytes("UTF-8");
|
| | | size = (bytes.length / 1024) + "k";
|
| | | log.info(size);
|
| | |
| | | msgBody.setData(mqBody);
|
| | | msgBody.setTotal(pageSize);
|
| | | mqEntity.setMsgBody(msgBody);
|
| | | Thread.sleep(1000 * 60 * 3);
|
| | | // Thread.sleep(1000 * 60 * 3);
|
| | | mqEntity.send2Mq();
|
| | | }
|
| | | }
|