Commit d04ef8dc authored by 廖旭伟's avatar 廖旭伟

修改bug

parent c5801060
package com.mortals.xhx.module.single.service.impl; package com.mortals.xhx.module.single.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.common.pdu.matter.MatterPdu;
import com.mortals.xhx.feign.matter.IMatterFeign;
import com.mortals.xhx.module.matter.model.MatterEntity; import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.matter.service.MatterService; import com.mortals.xhx.module.matter.service.MatterService;
import com.mortals.xhx.module.single.dao.SingleMatterFileDao; import com.mortals.xhx.module.single.dao.SingleMatterFileDao;
...@@ -28,7 +31,7 @@ import java.util.Date; ...@@ -28,7 +31,7 @@ import java.util.Date;
public class SingleMatterFileServiceImpl extends AbstractCRUDServiceImpl<SingleMatterFileDao, SingleMatterFileEntity, Long> implements SingleMatterFileService { public class SingleMatterFileServiceImpl extends AbstractCRUDServiceImpl<SingleMatterFileDao, SingleMatterFileEntity, Long> implements SingleMatterFileService {
@Autowired @Autowired
private MatterService matterService; private IMatterFeign matterService;
@Override @Override
protected void validData(SingleMatterFileEntity entity, Context context) throws AppException { protected void validData(SingleMatterFileEntity entity, Context context) throws AppException {
...@@ -60,15 +63,17 @@ public class SingleMatterFileServiceImpl extends AbstractCRUDServiceImpl<SingleM ...@@ -60,15 +63,17 @@ public class SingleMatterFileServiceImpl extends AbstractCRUDServiceImpl<SingleM
dao.update(update); dao.update(update);
} }
}else { }else {
MatterEntity matterEntity = matterService.get(entity.getMatterId()); String resp = matterService.info(entity.getMatterId());
if(matterEntity==null){ JSONObject jsonObject = JSONObject.parseObject(resp);
MatterPdu pdu = JSONObject.parseObject(jsonObject.getString("data"),MatterPdu.class);
if(pdu==null){
throw new AppException("基础事项id不正确,查不到对应的事项"); throw new AppException("基础事项id不正确,查不到对应的事项");
} }
entity.setMatterCode(matterEntity.getMatterNo()); entity.setMatterCode(pdu.getMatterNo());
entity.setMatterName(matterEntity.getMatterName()); entity.setMatterName(pdu.getMatterName());
if(entity.getSiteId()==null) { // if(entity.getSiteId()==null) {
entity.setSiteId(matterEntity.getSiteId()); // entity.setSiteId(pdu.getSiteId());
} // }
if(context!=null && context.getUser()!=null){ if(context!=null && context.getUser()!=null){
entity.setCreateUserId(context.getUser().getId()); entity.setCreateUserId(context.getUser().getId());
} }
......
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