Commit e13e48a9 by liuyang

调整设备日志定时任务

parent b9df6dd9
......@@ -6,12 +6,14 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.extapp.decheng.api.SbOpenApi;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.sb.domain.HGSB010;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
......@@ -174,8 +176,10 @@ public class ServiceHGSB010 extends ServiceEPBase {
public EiInfo add(EiInfo inInfo){
try {
Map paramMap = EiInfoUtils.getFirstRow(inInfo);
String accountCode = MapUtils.getString(paramMap, HGPZ009.FIELD_ACCOUNT_CODE);
JSONArray jsonArray = SbOpenApi.list(inInfo);
User user = HGXSTools.XsUser.getByLogin("HG0000");
User user = HGXSTools.XsUser.getByLogin(paramMap.get(User.FIELD_LOGIN_NAME).toString());
List<Map> list = jsonArray.stream().map(o -> (Map) o).collect(Collectors.toList());
for (Map map:list) {
HGSB010 hgsb010 = new HGSB010();
......@@ -183,10 +187,9 @@ public class ServiceHGSB010 extends ServiceEPBase {
if (user!=null){
hgsb010.setCompanyCode(user.getAccountCode());
}else {
hgsb010.setCompanyCode("Q24072514");
hgsb010.setCompanyCode(accountCode);
}
DaoUtils.insert(HGSB010.INSERT, hgsb010);
dao.insert(HGSB010.INSERT, hgsb010);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + jsonArray.size() + "]条数据新增成功!");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment