Commit 788c9c80 authored by 赵啸非's avatar 赵啸非

工作人员添加经办人id

parent f3123d9a
package com.mortals.xhx.module.business.service; package com.mortals.xhx.module.business.service;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result; import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICRUDService; import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.business.dao.BusinessMatterDao;
import com.mortals.xhx.module.business.model.BusinessMatterEntity; import com.mortals.xhx.module.business.model.BusinessMatterEntity;
import com.mortals.xhx.module.business.model.BusinessMatterQuery; import com.mortals.xhx.module.business.model.BusinessMatterQuery;
/** /**
* BusinessMatterService * BusinessMatterService
* * <p>
* 业务事项关联 service接口 * 业务事项关联 service接口
* *
* @author zxfei * @author zxfei
* @date 2022-01-12 * @date 2022-01-12
*/ */
public interface BusinessMatterService extends ICRUDService<BusinessMatterEntity,Long>{ public interface BusinessMatterService extends ICRUDService<BusinessMatterEntity, Long> {
BusinessMatterDao getDao();
Result<BusinessMatterEntity> getListByBusiness(BusinessMatterQuery query, PageInfo pageInfo, Context context); Result<BusinessMatterEntity> getListByBusiness(BusinessMatterQuery query, PageInfo pageInfo, Context context);
......
...@@ -24,6 +24,20 @@ import java.util.List; ...@@ -24,6 +24,20 @@ import java.util.List;
public class BusinessMatterServiceImpl extends AbstractCRUDServiceImpl<BusinessMatterDao, BusinessMatterEntity, Long> implements BusinessMatterService { public class BusinessMatterServiceImpl extends AbstractCRUDServiceImpl<BusinessMatterDao, BusinessMatterEntity, Long> implements BusinessMatterService {
/**
* @param entity
* @param context
* @throws AppException
*/
@Override
protected void saveBefore(BusinessMatterEntity entity, Context context) throws AppException {
super.saveBefore(entity, context);
int count = this.getDao().getCount(new BusinessMatterQuery().siteBusinessId(entity.getSiteBusinessId()).matterId(entity.getMatterId()));
if(count>0){
throw new AppException("当前业务事项已存在,不能新增");
}
}
/** /**
* @param list * @param list
* @param context * @param context
......
package com.mortals.xhx.module.business.web; package com.mortals.xhx.module.business.web;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result; import com.mortals.framework.model.Result;
...@@ -18,6 +19,8 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -18,6 +19,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map; import java.util.Map;
import static com.mortals.framework.ap.SysConstains.*; import static com.mortals.framework.ap.SysConstains.*;
...@@ -119,5 +122,23 @@ public class BusinessMatterController extends BaseCRUDJsonBodyMappingController< ...@@ -119,5 +122,23 @@ public class BusinessMatterController extends BaseCRUDJsonBodyMappingController<
} }
/**
* @param list
* @param model
* @param context
* @throws AppException
*/
@Override
protected void batchSaveBefore(List<BusinessMatterEntity> list, Map<String, Object> model, Context context) throws AppException {
//批量校验列表 如果存在 则剔除
Iterator<BusinessMatterEntity> iterator = list.iterator();
while (iterator.hasNext()) {
BusinessMatterEntity next = iterator.next();
int count = this.service.getDao().getCount(new BusinessMatterQuery().siteBusinessId(next.getSiteBusinessId()).matterId(next.getMatterId()));
if(count>0){
iterator.remove();
}
}
super.batchSaveBefore(list, model, context);
}
} }
\ No newline at end of file
...@@ -29,14 +29,15 @@ Content-Type: application/json ...@@ -29,14 +29,15 @@ Content-Type: application/json
###业务事项关联更新与保存 ###业务事项关联更新与保存
POST {{baseUrl}}/business/matter/save POST {{baseUrl}}/business/matter/save
Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"siteId":9255, "siteId":1,
"siteName":"w19oxc", "siteName":"w19oxc",
"siteBusinessId":7038, "siteBusinessId":11,
"siteBusinessName":"ujaud2", "siteBusinessName":"ujaud2",
"matterId":3913, "matterId":34034,
"matterName":"iajw6p" "matterName":"iajw6p"
} }
......
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