|
@@ -61,7 +61,6 @@ public class DepartmentManageAction implements IMINAction {
|
|
|
* 查询当前操作员所属机构以及下属机构信息
|
|
|
* @param page
|
|
|
* @param limit
|
|
|
- * @param branchLevel
|
|
|
* @param branchId
|
|
|
* @param branchName
|
|
|
* @param branchStatus
|
|
@@ -72,12 +71,11 @@ public class DepartmentManageAction implements IMINAction {
|
|
|
public MINActionResult branchQueryAll(
|
|
|
@MINParam(key = "page", defaultValue = "1") int page,
|
|
|
@MINParam(key = "limit", defaultValue = "3") int limit,
|
|
|
- @MINParam(key = "branchLevel") String[] branchLevel,
|
|
|
@MINParam(key = "branchId") String branchId,
|
|
|
- @MINParam(key = "type") String type,
|
|
|
@MINParam(key = "branchName") String branchName,
|
|
|
@MINParam(key = "branchStatus") String branchStatus,
|
|
|
- @MINParam(key = "branchType") String branchType,
|
|
|
+ @MINParam(key = "person") String person,
|
|
|
+ @MINParam(key = "phone") String phone,
|
|
|
@MINParam(key = "bIds") String bIds,
|
|
|
MINSession session
|
|
|
) throws MINBusinessException {
|
|
@@ -97,7 +95,8 @@ public class DepartmentManageAction implements IMINAction {
|
|
|
map.put("branchId", branchId);
|
|
|
map.put("branchName", branchName);
|
|
|
map.put("branchStatus", branchStatus);
|
|
|
- map.put("branchType", branchType);
|
|
|
+ map.put("person", person);
|
|
|
+ map.put("phone", phone);
|
|
|
List<Map<String, Object>> ls = null;
|
|
|
//如果操作员所属机构为系统机构则查询所有机构信息
|
|
|
if("88888888".equals(bId)){
|
|
@@ -192,18 +191,14 @@ public class DepartmentManageAction implements IMINAction {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
- * 修改部门
|
|
|
+ * 修改商户
|
|
|
* @param fapResult
|
|
|
- * @param pointNo
|
|
|
- * @param pointName
|
|
|
- * @param pointPerson
|
|
|
- * @param personTlephone
|
|
|
- * @param remark
|
|
|
- * @param address
|
|
|
- * @param shortName
|
|
|
- * @param content
|
|
|
+ * @param branchId
|
|
|
+ * @param branchName
|
|
|
+ * @param person
|
|
|
+ * @param phone
|
|
|
+ * @param desc
|
|
|
* @param session
|
|
|
* @return
|
|
|
* @throws MINBusinessException
|
|
@@ -211,42 +206,48 @@ public class DepartmentManageAction implements IMINAction {
|
|
|
@MINAction(value = MODIFY_BRANCH)
|
|
|
public MINActionResult modifyBranch(
|
|
|
MINHttpServletRequestContext fapResult,
|
|
|
- @MINParam(key ="branchId") String pointNo,
|
|
|
- @MINParam(key ="pointName") String pointName,
|
|
|
- @MINParam(key ="pointPerson") String pointPerson,
|
|
|
- @MINParam(key ="personTlephone") String personTlephone,
|
|
|
- @MINParam(key ="remark") String remark,
|
|
|
- @MINParam(key ="address") String address,
|
|
|
- @MINParam(key ="shortName") String shortName,
|
|
|
- @MINParam(key ="content") String content,
|
|
|
+ @MINParam(key ="branchId") String branchId,
|
|
|
+ @MINParam(key ="branchName") String branchName,
|
|
|
+ @MINParam(key ="person") String person,
|
|
|
+ @MINParam(key ="phone") String phone,
|
|
|
+ @MINParam(key ="desc") String desc,
|
|
|
MINSession session
|
|
|
) throws MINBusinessException {
|
|
|
MINActionResult res = new MINActionResult();
|
|
|
//检查部门名称
|
|
|
ImBranchExample ibe = new ImBranchExample();
|
|
|
- ibe.createCriteria().andNameEqualTo(pointName).andIdNotEqualTo(pointNo);
|
|
|
+ ibe.createCriteria().andNameEqualTo(branchName).andIdNotEqualTo(branchId);
|
|
|
List<ImBranch> branchList = Service.lookup(IMINDataBaseService.class).selectByExample(ImBranchMapper.class, ibe);
|
|
|
if(branchList.size()>0){
|
|
|
- throw new BusinessCodeException("JINM0108");
|
|
|
+ throw new MINBusinessException("商户名称已存在!");
|
|
|
}
|
|
|
ImBranch ib = new ImBranch();
|
|
|
-
|
|
|
- ib.setId(pointNo);
|
|
|
- ib.setName(pointName);
|
|
|
- ib.setPhone(personTlephone);
|
|
|
- ib.setPerson(pointPerson);
|
|
|
- ib.setDesc(remark);
|
|
|
- ib.setShortname(shortName);
|
|
|
- ib.setAddress(address);
|
|
|
+ ib.setId(branchId);
|
|
|
+ ib.setName(branchName);
|
|
|
+ ib.setPhone(phone);
|
|
|
+ ib.setPerson(person);
|
|
|
+ ib.setDesc(desc);
|
|
|
int i = Service.lookup(IMINDataBaseService.class).updateByPrimaryKeySelective(ImBranchMapper.class, ib);
|
|
|
if(0==i){
|
|
|
throw new MINBusinessException("插入数据时出现异常");
|
|
|
}
|
|
|
// 记录日志
|
|
|
- String logInfo = "修改部门 :"+pointName+",部门编号:"+pointNo;
|
|
|
+ String logInfo = "修改商户 :"+branchName+",商户编号:"+branchId;
|
|
|
Service.lookup(ILogService.class).logging(session, logInfo);
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
+ @MINValidator(value = MODIFY_BRANCH)
|
|
|
+ public MINActionResult modifyBranchValidator(
|
|
|
+ @MINParam(key ="branchId",regex = RegexUtil.NOT_NULL, error = "操作异常") String branchId,
|
|
|
+ @MINParam(key ="branchName",regex = RegexUtil.NOT_NULL,min = 0, max = 100, error = "商户名称不能1-100个字符") String branchName,
|
|
|
+ @MINParam(key ="person",regex = RegexUtil.NOT_NULL,min = 0, max = 100, error = "联系人不能超过1-30个字符") String person,
|
|
|
+ @MINParam(key ="phone", regex = RegexUtil.NOT_NULL,min = 0, max = 20, error = "联系方式不能超过1-20个字符") String phone,
|
|
|
+ @MINParam(key ="desc",max = 300, error = "描述不能超过300个字符") String desc,
|
|
|
+ MINSession session) throws MINBusinessException {
|
|
|
+ MINActionResult res = new MINActionResult();
|
|
|
+ return res;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -259,9 +260,13 @@ public class DepartmentManageAction implements IMINAction {
|
|
|
@MINAction(value = DELETE_BRANCH)
|
|
|
public MINActionResult deleteBranch(
|
|
|
@MINParam(key ="branchId") String branchId,
|
|
|
+ @MINParam(key ="state") String state,
|
|
|
MINSession session
|
|
|
) throws MINBusinessException {
|
|
|
MINActionResult res = new MINActionResult();
|
|
|
+ if(!"0".equals(state) && !"1".equals(state) && !"2".equals(state)){
|
|
|
+ throw new MINBusinessException("数据异常");
|
|
|
+ }
|
|
|
//查询改部门下 有无操作员
|
|
|
ImUserExample example = new ImUserExample();
|
|
|
example.createCriteria().andBranchidEqualTo(branchId);
|
|
@@ -272,7 +277,7 @@ public class DepartmentManageAction implements IMINAction {
|
|
|
}else {
|
|
|
ImBranch ib = new ImBranch();
|
|
|
ib.setId(branchId);
|
|
|
- ib.setStt(Constant.DEPT_STT_DEL);
|
|
|
+ ib.setStt(state);
|
|
|
int ret = Service.lookup(IMINDataBaseService.class).updateByPrimaryKeySelective(ImBranchMapper.class, ib);
|
|
|
if(0 == ret){
|
|
|
throw new MINBusinessException("更新数据时出现异常");
|
|
@@ -282,6 +287,15 @@ public class DepartmentManageAction implements IMINAction {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
+ @MINValidator(value = DELETE_BRANCH)
|
|
|
+ public MINActionResult deleteBranchValidator(
|
|
|
+ @MINParam(key ="branchId",regex = RegexUtil.NOT_NULL, error = "数据异常") String branchId,
|
|
|
+ @MINParam(key ="state",regex = RegexUtil.NOT_NULL,error = "数据异常") String state,
|
|
|
+ MINSession session) throws MINBusinessException {
|
|
|
+ MINActionResult res = new MINActionResult();
|
|
|
+ return res;
|
|
|
+ }
|
|
|
/**
|
|
|
* 查看该部门人员
|
|
|
* @param branchId
|