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

修改bug

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