bug修复
This commit is contained in:
parent
a8edbfab2f
commit
f7f2cb962c
|
|
@ -19,5 +19,7 @@ public class ProjectBean {
|
|||
private Integer subcontractorNum;
|
||||
private Integer evaluateDeptId;
|
||||
private Integer personInChargeId;
|
||||
// 所属事业部Id
|
||||
private Integer departmentId;
|
||||
private String keyWord;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,9 @@ public class ProjectController {
|
|||
AjaxRes ar = new AjaxRes();
|
||||
try {
|
||||
Integer i = service.updateName(projectBean);
|
||||
if (i > 0) {
|
||||
if (i == 100) {
|
||||
ar.setFailMsg("该事业部下班组名称已重复");
|
||||
} else if (i > 0) {
|
||||
ar.setSucceedMsg("修改成功");
|
||||
} else {
|
||||
ar.setFailMsg("修改失败");
|
||||
|
|
|
|||
|
|
@ -29,4 +29,6 @@ public interface ProjectDao {
|
|||
Integer delProjectSubcontractor(ViolationBean bean);
|
||||
|
||||
List<OrganizationalBean> getNoBindSubcontractorSelect(ViolationBean bean);
|
||||
|
||||
int getProjectByName(ProjectBean projectBean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,12 @@ public class ProjectServiceImpl implements ProjectService {
|
|||
|
||||
@Override
|
||||
public Integer updateName(ProjectBean projectBean) {
|
||||
if (projectDao.getProjectByName(projectBean) > 0) {
|
||||
return 100;
|
||||
}
|
||||
return projectDao.updateName(projectBean);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
|
||||
@GetMapping("outsourceEnterpriseByPage")
|
||||
@ResponseBody
|
||||
public AjaxRes outsourceEnterpriseByPage(ViolationBean o){
|
||||
public AjaxRes outsourceEnterpriseByPage(ViolationBean o) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
List<ViolationBean> list = service.getOutsourceEnterpriseByPage(o);
|
||||
for (ViolationBean violationBean : list) {
|
||||
|
|
@ -73,6 +73,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
|
||||
/**
|
||||
* 添加外包企业
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -113,6 +114,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
|
||||
/**
|
||||
* 外包企业表单复现
|
||||
*
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -129,6 +131,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
|
||||
/**
|
||||
* 修改外包企业
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -148,6 +151,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
|
||||
/**
|
||||
* 删除外包企业
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -158,15 +162,15 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
try {
|
||||
String[] idArr = id.split(",");
|
||||
int result = service.outsourceEnterpriseDelete(idArr);
|
||||
if(result > 0) {
|
||||
if (result > 0) {
|
||||
ar.setRes(GlobalConst.SUCCEED);
|
||||
ar.setResMsg("删除成功");
|
||||
}else {
|
||||
} else {
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
ar.setResMsg("删除失败,请联系系统管理员");
|
||||
}
|
||||
|
||||
}catch(Exception e) {
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
|
|
@ -184,7 +188,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
result.setPhone(AesCbcUtils.encrypt(result.getPhone()));
|
||||
ar.setSucceed(result);
|
||||
|
||||
}catch(Exception e) {
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
|
|
@ -202,6 +206,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("exportTeamGroupPerson")
|
||||
public void exportTeamGroupPerson(HttpServletRequest request, HttpServletResponse response, TeamGroupBean teamGroupBean) {
|
||||
String filename = "班组人员详情表";
|
||||
|
|
@ -221,7 +226,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
AjaxRes ars = getAjaxRes();
|
||||
Integer result = 0;
|
||||
int errorNum = 0;
|
||||
Map<String,ImportUserDataVo> map=new HashMap<String,ImportUserDataVo>();
|
||||
Map<String, ImportUserDataVo> map = new HashMap<String, ImportUserDataVo>();
|
||||
try {
|
||||
String fileName = file.getOriginalFilename();
|
||||
System.out.println("OriginalFilename:" + fileName);
|
||||
|
|
@ -246,6 +251,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
if (hssfSheet != null) {
|
||||
// 遍历行row,continue只是终止本次循环,接着还执行后面的循环
|
||||
int rowNum = hssfSheet.getLastRowNum();
|
||||
boolean hasEmptyRow = false;
|
||||
// 从第三行开始
|
||||
for (int rownum = 2; rownum <= rowNum; rownum++) {
|
||||
// 获取到每一行
|
||||
|
|
@ -256,19 +262,23 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
Row row = hssfSheet.getRow(rownum);
|
||||
if (sheetRow != null && !isRowEmpty(sheetRow)) {
|
||||
// 先去判断
|
||||
ars = compareSaveData(sheetRow, rownum + 1,map);
|
||||
ars = compareSaveData(sheetRow, rownum + 1, map);
|
||||
if (ars.getRes() == 2) {
|
||||
ar.setFailMsg(ars.getResMsg());
|
||||
result = 2;
|
||||
return ar;
|
||||
}
|
||||
} else {
|
||||
ar.setFailMsg("第 " + (rownum + 1) + " 行数据为空,导入失败");
|
||||
ar.setRes(0);
|
||||
return ar;
|
||||
}
|
||||
}
|
||||
if (result != 2) {
|
||||
for (int rownums = 2; rownums <= rowNum; rownums++) {
|
||||
Row sheetRows = hssfSheet.getRow(rownums);
|
||||
if (sheetRows != null && !isRowEmpty(sheetRows)) {
|
||||
ar = addSaveData(sheetRows,rownums+1);
|
||||
ar = addSaveData(sheetRows, rownums + 1);
|
||||
if (ar.getRes() == 0) {
|
||||
return ar;
|
||||
}
|
||||
|
|
@ -278,8 +288,8 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
ar.setSucceedMsg("外包公司导入成功!");
|
||||
return ar;
|
||||
}
|
||||
}else {
|
||||
ar.setFailMsg("第" + (errorNum-1) + "行数据有误字段不能为空,导入失败");
|
||||
} else {
|
||||
ar.setFailMsg("第" + (errorNum - 1) + "行数据有误字段不能为空,导入失败");
|
||||
}
|
||||
}
|
||||
if (wb != null) {
|
||||
|
|
@ -292,7 +302,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
return ar;
|
||||
}
|
||||
|
||||
private AjaxRes compareSaveData(Row sheetRow, int rownum,Map<String,ImportUserDataVo> map) throws Exception {
|
||||
private AjaxRes compareSaveData(Row sheetRow, int rownum, Map<String, ImportUserDataVo> map) throws Exception {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
String enterpriseName = getValue(sheetRow.getCell(0)).trim();
|
||||
|
|
@ -302,68 +312,68 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
String idCard = getValue(sheetRow.getCell(4)).trim();
|
||||
String phone = translateToPlainStr(getValue(sheetRow.getCell(5)).trim());
|
||||
if (StringUtils.isBlank(enterpriseName) || StringUtils.isBlank(socialCreditCode) || StringUtils.isBlank(setTime) || StringUtils.isBlank(corporateName) || StringUtils.isBlank(idCard) || StringUtils.isBlank(phone)) {
|
||||
ar.setFailMsg("第" + (rownum-1) + "行数据有误字段不能为空,导入失败");
|
||||
ar.setFailMsg("第" + (rownum - 1) + "行数据有误字段不能为空,导入失败");
|
||||
ar.setRes(2);
|
||||
return ar;
|
||||
}
|
||||
ImportUserDataVo importUserDataVo=new ImportUserDataVo();
|
||||
ImportUserDataVo importUserDataVo = new ImportUserDataVo();
|
||||
importUserDataVo.setName(enterpriseName);
|
||||
Integer num=service.getImportDataCheck(importUserDataVo);
|
||||
if (num!=null && num>0) {
|
||||
ar.setFailMsg("第" + (rownum-1) + "行企业名称已存在");
|
||||
Integer num = service.getImportDataCheck(importUserDataVo);
|
||||
if (num != null && num > 0) {
|
||||
ar.setFailMsg("第" + (rownum - 1) + "行企业名称已存在");
|
||||
ar.setRes(2);
|
||||
return ar;
|
||||
}
|
||||
importUserDataVo=new ImportUserDataVo();
|
||||
importUserDataVo = new ImportUserDataVo();
|
||||
importUserDataVo.setUserPhone(phone);
|
||||
num=service.getImportDataCheck(importUserDataVo);
|
||||
if (num!=null && num>0) {
|
||||
ar.setFailMsg("第" + (rownum-1) + "手机号已存在");
|
||||
num = service.getImportDataCheck(importUserDataVo);
|
||||
if (num != null && num > 0) {
|
||||
ar.setFailMsg("第" + (rownum - 1) + "手机号已存在");
|
||||
ar.setRes(2);
|
||||
return ar;
|
||||
}
|
||||
importUserDataVo=new ImportUserDataVo();
|
||||
importUserDataVo = new ImportUserDataVo();
|
||||
importUserDataVo.setIdCard(idCard);
|
||||
num=service.getImportDataCheck(importUserDataVo);
|
||||
if (num!=null && num>0) {
|
||||
ar.setFailMsg("第" + (rownum-1) + "身份证号码已存在");
|
||||
num = service.getImportDataCheck(importUserDataVo);
|
||||
if (num != null && num > 0) {
|
||||
ar.setFailMsg("第" + (rownum - 1) + "身份证号码已存在");
|
||||
ar.setRes(2);
|
||||
return ar;
|
||||
}
|
||||
importUserDataVo=new ImportUserDataVo();
|
||||
importUserDataVo = new ImportUserDataVo();
|
||||
importUserDataVo.setCode(socialCreditCode);
|
||||
num=service.getImportDataCheck(importUserDataVo);
|
||||
if (num!=null && num>0) {
|
||||
ar.setFailMsg("第" + (rownum-1) + "统一社会信用代码已存在");
|
||||
num = service.getImportDataCheck(importUserDataVo);
|
||||
if (num != null && num > 0) {
|
||||
ar.setFailMsg("第" + (rownum - 1) + "统一社会信用代码已存在");
|
||||
ar.setRes(2);
|
||||
return ar;
|
||||
}
|
||||
|
||||
importUserDataVo.setRow(rownum-1);
|
||||
ImportUserDataVo his=map.get(socialCreditCode);
|
||||
if(his!=null){
|
||||
ar.setFailMsg("第" + (rownum-1) + "行与"+his.getRow()+"行统一社会信用代码重复!");
|
||||
importUserDataVo.setRow(rownum - 1);
|
||||
ImportUserDataVo his = map.get(socialCreditCode);
|
||||
if (his != null) {
|
||||
ar.setFailMsg("第" + (rownum - 1) + "行与" + his.getRow() + "行统一社会信用代码重复!");
|
||||
ar.setRes(2);
|
||||
return ar;
|
||||
}else{
|
||||
map.put(socialCreditCode,importUserDataVo);
|
||||
} else {
|
||||
map.put(socialCreditCode, importUserDataVo);
|
||||
}
|
||||
|
||||
his=map.get(idCard);
|
||||
if(his!=null){
|
||||
ar.setFailMsg("第" + (rownum-1) + "行与"+his.getRow()+"行身份证号码重复!");
|
||||
his = map.get(idCard);
|
||||
if (his != null) {
|
||||
ar.setFailMsg("第" + (rownum - 1) + "行与" + his.getRow() + "行身份证号码重复!");
|
||||
ar.setRes(2);
|
||||
return ar;
|
||||
}else{
|
||||
map.put(idCard,importUserDataVo);
|
||||
} else {
|
||||
map.put(idCard, importUserDataVo);
|
||||
}
|
||||
|
||||
his=map.get(phone);
|
||||
if(his!=null){
|
||||
ar.setFailMsg("第" + (rownum-1) + "行与"+his.getRow()+"行手机号重复!");
|
||||
his = map.get(phone);
|
||||
if (his != null) {
|
||||
ar.setFailMsg("第" + (rownum - 1) + "行与" + his.getRow() + "行手机号重复!");
|
||||
ar.setRes(2);
|
||||
}else{
|
||||
map.put(idCard,importUserDataVo);
|
||||
} else {
|
||||
map.put(idCard, importUserDataVo);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
|
|
@ -373,7 +383,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
return ar;
|
||||
}
|
||||
|
||||
private AjaxRes addSaveData(Row sheetRow,int row) throws Exception {
|
||||
private AjaxRes addSaveData(Row sheetRow, int row) throws Exception {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
ViolationBean bean = new ViolationBean();
|
||||
|
|
@ -391,7 +401,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
bean.setIdCard(idCard);
|
||||
bean.setPhone(phone);
|
||||
bean.setAddress(address);
|
||||
ar=service.updateShopBaseInfo(bean,row);
|
||||
ar = service.updateShopBaseInfo(bean, row);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.IMP_FAIL);
|
||||
|
|
@ -463,7 +473,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
}
|
||||
|
||||
public String translateToPlainStr(String number) {
|
||||
String regEx="^([\\+|-]?\\d+(.{0}|.\\d+))[Ee]{1}([\\+|-]?\\d+)$";
|
||||
String regEx = "^([\\+|-]?\\d+(.{0}|.\\d+))[Ee]{1}([\\+|-]?\\d+)$";
|
||||
// 编译正则表达式
|
||||
Pattern pattern = Pattern.compile(regEx);
|
||||
// 忽略大小写的写法
|
||||
|
|
@ -472,7 +482,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
// 字符串是否与正则表达式相匹配
|
||||
boolean rs = matcher.matches();
|
||||
// 判断是否为字符串的科学计数法
|
||||
if(rs){
|
||||
if (rs) {
|
||||
// 科学计数法转数字
|
||||
BigDecimal originValue = new BigDecimal(number);
|
||||
// 数字转字符串
|
||||
|
|
@ -504,6 +514,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
private void excelOutTeamGroupPersons(HttpServletResponse response, List<TeamGroupBean> registlist, String filename, String sheetname)
|
||||
throws Exception {
|
||||
if (registlist != null) {
|
||||
|
|
@ -558,7 +569,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
maps.put("operatorId", bean.getOperatorId());
|
||||
maps.put("createTime", bean.getCreateTime());
|
||||
break;
|
||||
case"外包公司详情表":
|
||||
case "外包公司详情表":
|
||||
maps.put("enterpriseName", bean.getEnterpriseName());
|
||||
maps.put("socialCreditCode", bean.getSocialCreditCode());
|
||||
maps.put("setTime", bean.getSetTime());
|
||||
|
|
@ -568,7 +579,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
maps.put("proNum", bean.getProNum());
|
||||
maps.put("address", bean.getAddress());
|
||||
break;
|
||||
case"人员违章记录表":
|
||||
case "人员违章记录表":
|
||||
maps.put("name", bean.getName());
|
||||
maps.put("sex", bean.getSex());
|
||||
maps.put("idCard", bean.getIdCard());
|
||||
|
|
@ -584,6 +595,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
|
||||
return maps;
|
||||
}
|
||||
|
||||
private Map<String, Object> outVehicleOilBeanMap(int i, TeamGroupBean bean, String sheetname) {
|
||||
Map<String, Object> maps = new LinkedHashMap<String, Object>();
|
||||
maps.put("id", i + 1);
|
||||
|
|
@ -637,7 +649,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
list.add("操作人");
|
||||
list.add("操作时间");
|
||||
break;
|
||||
case"外包公司详情表":
|
||||
case "外包公司详情表":
|
||||
list.add("企业名称");
|
||||
list.add("统一社会信用代码");
|
||||
list.add("成立日期");
|
||||
|
|
@ -647,7 +659,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
list.add("项目数量");
|
||||
list.add("单位地址");
|
||||
break;
|
||||
case"人员违章记录表":
|
||||
case "人员违章记录表":
|
||||
list.add("姓名");
|
||||
list.add("性别");
|
||||
list.add("身份证号码");
|
||||
|
|
@ -657,7 +669,7 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
list.add("剩余记分");
|
||||
list.add("违章次数");
|
||||
break;
|
||||
case"班组人员详情表":
|
||||
case "班组人员详情表":
|
||||
list.add("所属分包商");
|
||||
list.add("所属项目");
|
||||
list.add("所属班组");
|
||||
|
|
@ -675,8 +687,5 @@ public class ViolationController extends BaseController<ViolationBean> {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -169,7 +169,8 @@
|
|||
status,
|
||||
org_type orgType
|
||||
FROM pm_org_info
|
||||
WHERE status = 1 and level in (1, 2)
|
||||
WHERE status = 1
|
||||
-- and level in (1, 2)
|
||||
</select>
|
||||
<select id="getDataDetails" resultType="com.bonus.gs.sub.evaluate.evaluate.beans.OrganizationalBean">
|
||||
select id,
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
SELECT
|
||||
poi1.id,
|
||||
poi1.name as projectName,
|
||||
poi2.id as departmentId,
|
||||
poi2.name as department,
|
||||
poi1.user_name as projectManager
|
||||
FROM
|
||||
|
|
@ -106,4 +107,15 @@
|
|||
pa.is_active = '1'
|
||||
AND NOT EXISTS ( SELECT 1 FROM pm_org_info poi WHERE poi.lk_id = pa.id AND poi.parent_id = #{id} )
|
||||
</select>
|
||||
<select id="getProjectByName" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
count(*)
|
||||
FROM
|
||||
pm_org_info poi
|
||||
left join pm_org_info poi2 on poi2.id = poi.parent_id
|
||||
WHERE
|
||||
poi.name = #{projectName} and poi2.id = #{departmentId}
|
||||
AND poi.level = 3
|
||||
AND poi.status = 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ function updateName(data,id) {
|
|||
let url = `${ctxPath}` + "/project/updateName";
|
||||
let item = {
|
||||
id: id,
|
||||
departmentId: objParam.departmentId,
|
||||
projectName: data.field.projectName,
|
||||
};
|
||||
// console.log(JSON.stringify(data)+"data")
|
||||
|
|
|
|||
|
|
@ -122,13 +122,12 @@ function submitApply(data) {
|
|||
|
||||
// 关闭页面
|
||||
function closePage(type) {
|
||||
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
|
||||
// 获取当前 iframe 层的索引
|
||||
let index = parent.layer.getFrameIndex(window.name);
|
||||
if (type === 1) {
|
||||
if (objParam.operType === 'back') {
|
||||
window.parent.reloadTreeTable();
|
||||
}else{
|
||||
// 调用父页面的方法(例如刷新列表)
|
||||
window.parent.search(1);
|
||||
}
|
||||
}
|
||||
parent.layer.close(index); // 再执行关闭
|
||||
// 关闭当前弹出层
|
||||
parent.layer.close(index);
|
||||
}
|
||||
|
|
@ -164,7 +164,7 @@
|
|||
</div>
|
||||
<div class="btn-box">
|
||||
<button class="layui-btn layui-btn-normal save" onclick="saveData2()">提交</button>
|
||||
<button class="layui-btn layui-btn-primary cancel" onclick="closePage()">取消</button>
|
||||
<!-- <button class="layui-btn layui-btn-primary cancel" onclick="closePage()">取消</button>-->
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../js/publicJs.js"></script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue