机具库存收藏修改
This commit is contained in:
parent
5d6389bf3f
commit
79c3b3124d
|
|
@ -352,8 +352,22 @@
|
||||||
FROM bm_project
|
FROM bm_project
|
||||||
WHERE `NAME` = #{name}
|
WHERE `NAME` = #{name}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="findByCode" resultType="com.bonus.bm.beans.ProjectManageBean">
|
||||||
|
SELECT ID, `NAME`
|
||||||
|
FROM bm_project
|
||||||
|
WHERE `NUM` = #{projectCode}
|
||||||
|
</select>
|
||||||
|
<update id="updateProject">
|
||||||
|
UPDATE bm_project
|
||||||
|
set NUM = #{num}
|
||||||
|
where ID = #{id}
|
||||||
|
</update>
|
||||||
|
<update id="updateProjectName">
|
||||||
|
UPDATE bm_project
|
||||||
|
set NAME = #{projectName}
|
||||||
|
where NUM = #{projectCode}
|
||||||
|
</update>
|
||||||
<select id="getProvinces" resultType="com.bonus.bm.beans.ProjectManageBean" parameterType="com.bonus.bm.beans.ProjectManageBean">
|
<select id="getProvinces" resultType="com.bonus.bm.beans.ProjectManageBean" parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||||
SELECT provinceid as id, province as name FROM provinces ORDER BY id
|
SELECT provinceid as id, province as name FROM provinces ORDER BY id
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
|
|
@ -33,375 +33,363 @@ import com.bonus.sys.beans.ZNode;
|
||||||
@RequestMapping("/backstage/project/")
|
@RequestMapping("/backstage/project/")
|
||||||
public class ProjectManageController extends BaseController<ProjectManageBean> {
|
public class ProjectManageController extends BaseController<ProjectManageBean> {
|
||||||
|
|
||||||
// 16位KEY
|
// 16位KEY
|
||||||
private static final String aesKey = "Z3PX8V9KJ2T7W4QN";
|
private static final String aesKey = "Z3PX8V9KJ2T7W4QN";
|
||||||
// 密钥
|
// 密钥
|
||||||
private static final String appSecret = "secret20250705";
|
private static final String appSecret = "secret20250705";
|
||||||
// appID
|
// appID
|
||||||
private static final String allowAppId = "equipment";
|
private static final String allowAppId = "equipment";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProjectManageService pmService;
|
private ProjectManageService pmService;
|
||||||
|
|
||||||
@RequestMapping("list")
|
@RequestMapping("list")
|
||||||
public String index(Model model) {
|
public String index(Model model) {
|
||||||
return "/bm/projectManage";
|
return "/bm/projectManage";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("projectTree")
|
@RequestMapping("projectTree")
|
||||||
public String unitTree(Model model) {
|
public String unitTree(Model model) {
|
||||||
return "/bm/projectTree";
|
return "/bm/projectTree";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 与数创部同步工程信息,单次接收1条
|
* 与数创部同步工程信息,单次接收1条
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "syncProject", method = RequestMethod.POST)
|
@RequestMapping(value = "syncProject", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxRes syncProject(@RequestBody JSONObject payload) {
|
public AjaxRes syncProject(@RequestBody JSONObject payload) {
|
||||||
AjaxRes result = getAjaxRes();
|
AjaxRes result = getAjaxRes();
|
||||||
if (payload == null) {
|
if (payload == null) {
|
||||||
result.setFailMsg("同步错误,参数不能为空!");
|
result.setFailMsg("同步错误,参数不能为空!");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
String appId = payload.getStr("appId");
|
String appId = payload.getStr("appId");
|
||||||
String timestamp = payload.getStr("timestamp");
|
String timestamp = payload.getStr("timestamp");
|
||||||
String encryptedData = payload.getStr("data");
|
String encryptedData = payload.getStr("data");
|
||||||
String sign = payload.getStr("sign");
|
String sign = payload.getStr("sign");
|
||||||
|
|
||||||
// 1. 校验appId
|
// 1. 校验appId
|
||||||
if (Objects.isNull(appId) || !allowAppId.equals(appId)) {
|
if (Objects.isNull(appId) || !allowAppId.equals(appId)) {
|
||||||
result.setFailMsg("appId不匹配");
|
result.setFailMsg("appId不匹配");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. 时间戳校验(防重放)
|
// 3. 验证签名
|
||||||
// try {
|
String baseSign = appId + timestamp + encryptedData + appSecret;
|
||||||
// Date time = DateUtil.parse(timestamp, "yyyyMMddHHmmss");
|
String serverSign = SecureUtil.sha256(baseSign).toUpperCase();
|
||||||
// long diff = Math.abs(System.currentTimeMillis() - time.getTime());
|
if (!serverSign.equals(sign)) {
|
||||||
// if (diff > 5 * 60 * 1000) {
|
result.setFailMsg("签名不合法!");
|
||||||
// result.setFailMsg("请求时间戳不合法!!");
|
return result;
|
||||||
// return result;
|
}
|
||||||
// }
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// System.err.println("时间戳解析异常:" + timestamp + "," + e.getMessage());
|
|
||||||
// result.setFailMsg("时间戳解析异常");
|
|
||||||
// return result;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 3. 验证签名
|
// 4. 解密数据
|
||||||
String baseSign = appId + timestamp + encryptedData + appSecret;
|
AES aes = SecureUtil.aes(aesKey.getBytes());
|
||||||
String serverSign = SecureUtil.sha256(baseSign).toUpperCase();
|
String json = aes.decryptStr(encryptedData);
|
||||||
if (!serverSign.equals(sign)) {
|
JSONObject bizData = JSONUtil.parseObj(json);
|
||||||
result.setFailMsg("签名不合法!");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 4. 解密数据
|
// 5. 业务处理
|
||||||
AES aes = SecureUtil.aes(aesKey.getBytes());
|
String projectCode = bizData.getStr("projectCode");
|
||||||
String json = aes.decryptStr(encryptedData);
|
String projectName = bizData.getStr("projectName");
|
||||||
JSONObject bizData = JSONUtil.parseObj(json);
|
String companyCode = bizData.getStr("companyCode");
|
||||||
|
String typeCode = bizData.getStr("typeCode");
|
||||||
|
String startDate = bizData.getStr("startDate", "");
|
||||||
|
String status = bizData.getStr("status");
|
||||||
|
|
||||||
// 5. 业务处理
|
// 6. 校验数据
|
||||||
String projectCode = bizData.getStr("projectCode");
|
if (StrUtil.isBlank(projectCode) || StrUtil.isBlank(projectName) || StrUtil.isBlank(companyCode)
|
||||||
String projectName = bizData.getStr("projectName");
|
|| StrUtil.isBlank(typeCode) || StrUtil.isBlank(status)) {
|
||||||
String companyCode = bizData.getStr("companyCode");
|
System.err.println(projectCode + "," + projectName + "," + companyCode + "," + typeCode + "," + status + ","
|
||||||
String typeCode = bizData.getStr("typeCode");
|
+ startDate);
|
||||||
String startDate = bizData.getStr("startDate", "");
|
result.setFailMsg("数据不完整!!");
|
||||||
String status = bizData.getStr("status");
|
return result;
|
||||||
|
} else {
|
||||||
|
ProjectManageBean beanCode = pmService.findByCode(projectCode);
|
||||||
|
if (beanCode == null) {
|
||||||
|
ProjectManageBean findBean = pmService.findByName(projectName);
|
||||||
|
if (findBean != null) {
|
||||||
|
pmService.updateProject(projectCode, String.valueOf(findBean.getId()));
|
||||||
|
result.setFailMsg("工程名称已存在,跳过处理!");
|
||||||
|
} else {
|
||||||
|
ProjectManageBean bean = new ProjectManageBean();
|
||||||
|
bean.setName(projectName);
|
||||||
|
bean.setNum(projectCode);
|
||||||
|
bean.setCompanyId(companyCode);
|
||||||
|
bean.setTypeId(typeCode);
|
||||||
|
bean.setStartTime(startDate);
|
||||||
|
bean.setEndTime("");
|
||||||
|
try {
|
||||||
|
pmService.insert(bean);
|
||||||
|
System.out.println("同步工程数据成功: " + json);
|
||||||
|
result.setSucceedMsg("同步成功");
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.err.println(e.getMessage());
|
||||||
|
result.setFailMsg(projectName + "----工程信息同步失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
pmService.updateProjectName(projectName, projectCode);
|
||||||
|
}
|
||||||
|
|
||||||
// 6. 校验数据
|
}
|
||||||
if (StrUtil.isBlank(projectCode) || StrUtil.isBlank(projectName) || StrUtil.isBlank(companyCode)
|
return result;
|
||||||
|| StrUtil.isBlank(typeCode) || StrUtil.isBlank(status)) {
|
}
|
||||||
System.err.println(projectCode + "," + projectName + "," + companyCode + "," + typeCode + "," + status + ","
|
|
||||||
+ startDate);
|
|
||||||
result.setFailMsg("数据不完整!!");
|
|
||||||
return result;
|
|
||||||
} else {
|
|
||||||
ProjectManageBean findBean = pmService.findByName(projectName);
|
|
||||||
if (findBean != null) {
|
|
||||||
System.out.println("工程名称已存在,跳过处理!");
|
|
||||||
result.setFailMsg("工程名称已存在,跳过处理!");
|
|
||||||
} else {
|
|
||||||
ProjectManageBean bean = new ProjectManageBean();
|
|
||||||
bean.setName(projectName);
|
|
||||||
bean.setNum(projectCode);
|
|
||||||
bean.setCompanyId(companyCode);
|
|
||||||
bean.setTypeId(typeCode);
|
|
||||||
bean.setStartTime(startDate);
|
|
||||||
bean.setEndTime("");
|
|
||||||
try {
|
|
||||||
pmService.insert(bean);
|
|
||||||
System.out.println("同步工程数据成功: " + json);
|
|
||||||
result.setSucceedMsg("同步成功");
|
|
||||||
} catch (Exception e) {
|
|
||||||
System.err.println(e.getMessage());
|
|
||||||
result.setFailMsg(projectName + "----工程信息同步失败:" + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequestMapping(value = "findByPage", method = RequestMethod.POST)
|
@RequestMapping(value = "findByPage", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxRes findByPage(Page<ProjectManageBean> page, ProjectManageBean o) {
|
public AjaxRes findByPage(Page<ProjectManageBean> page, ProjectManageBean o) {
|
||||||
AjaxRes ar = getAjaxRes();
|
AjaxRes ar = getAjaxRes();
|
||||||
if (ar.setNoAuth(doSecurityIntercept(GlobalConst.RESOURCES_TYPE_MENU, "/backstage/project/list"))) {
|
if (ar.setNoAuth(doSecurityIntercept(GlobalConst.RESOURCES_TYPE_MENU, "/backstage/project/list"))) {
|
||||||
try {
|
try {
|
||||||
if (o != null && !"".equals(o.getEndTime())) {
|
if (o != null && !"".equals(o.getEndTime())) {
|
||||||
String time = DateTimeHelper.getAddNumDay(o.getEndTime(), 1);
|
String time = DateTimeHelper.getAddNumDay(o.getEndTime(), 1);
|
||||||
o.setEndTime(time);
|
o.setEndTime(time);
|
||||||
}
|
}
|
||||||
Page<ProjectManageBean> station = pmService.findByPage(o, page);
|
Page<ProjectManageBean> station = pmService.findByPage(o, page);
|
||||||
Map<String, Object> p = new HashMap<String, Object>();
|
Map<String, Object> p = new HashMap<String, Object>();
|
||||||
p.put("list", station);
|
p.put("list", station);
|
||||||
ar.setSucceed(p);
|
ar.setSucceed(p);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.toString(), e);
|
logger.error(e.toString(), e);
|
||||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "insert", method = RequestMethod.POST)
|
@RequestMapping(value = "insert", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxRes insert(ProjectManageBean o) {
|
public AjaxRes insert(ProjectManageBean o) {
|
||||||
AjaxRes ar = getAjaxRes();
|
AjaxRes ar = getAjaxRes();
|
||||||
try {
|
try {
|
||||||
ProjectManageBean bean = pmService.findByName(o.getName());
|
ProjectManageBean bean = pmService.findByName(o.getName());
|
||||||
if (bean == null) {
|
if (bean == null) {
|
||||||
String typeId = o.getTypeId1();
|
String typeId = o.getTypeId1();
|
||||||
String companyId = o.getCompanyId1();
|
String companyId = o.getCompanyId1();
|
||||||
|
|
||||||
String provinceid = o.getProvinceid();
|
String provinceid = o.getProvinceid();
|
||||||
String cityid = o.getCityid();
|
String cityid = o.getCityid();
|
||||||
String areaid = o.getAreaid();
|
String areaid = o.getAreaid();
|
||||||
if ("0".equals(typeId) || "0".equals(companyId)) {
|
if ("0".equals(typeId) || "0".equals(companyId)) {
|
||||||
ar.setFailMsg("请选择所属分公司或者工程类别");
|
ar.setFailMsg("请选择所属分公司或者工程类别");
|
||||||
} else if ("0".equals(provinceid)) {
|
} else if ("0".equals(provinceid)) {
|
||||||
ar.setFailMsg("请选择所在省");
|
ar.setFailMsg("请选择所在省");
|
||||||
} else if ("0".equals(cityid)) {
|
} else if ("0".equals(cityid)) {
|
||||||
ar.setFailMsg("请选择所在市");
|
ar.setFailMsg("请选择所在市");
|
||||||
} else if ("0".equals(areaid)) {
|
} else if ("0".equals(areaid)) {
|
||||||
ar.setFailMsg("请选择所在区");
|
ar.setFailMsg("请选择所在区");
|
||||||
} else {
|
} else {
|
||||||
pmService.insert(o);
|
pmService.insert(o);
|
||||||
//塞入bid_id
|
ar.setSucceedMsg(GlobalConst.SAVE_SUCCEED);
|
||||||
if (o.getId()!=null){
|
}
|
||||||
pmService.updateBidId(o);
|
} else {
|
||||||
}
|
ar.setFailMsg("工程名称重复,请重新填写");
|
||||||
ar.setSucceedMsg(GlobalConst.SAVE_SUCCEED);
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
} else {
|
logger.error(e.toString(), e);
|
||||||
ar.setFailMsg("工程名称重复,请重新填写");
|
ar.setFailMsg(GlobalConst.SAVE_FAIL);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
return ar;
|
||||||
logger.error(e.toString(), e);
|
}
|
||||||
ar.setFailMsg(GlobalConst.SAVE_FAIL);
|
|
||||||
}
|
|
||||||
return ar;
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequestMapping(value = "update", method = RequestMethod.POST)
|
@RequestMapping(value = "update", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxRes update(ProjectManageBean o) {
|
public AjaxRes update(ProjectManageBean o) {
|
||||||
AjaxRes ar = getAjaxRes();
|
AjaxRes ar = getAjaxRes();
|
||||||
try {
|
try {
|
||||||
|
|
||||||
String typeId = o.getTypeId1();
|
String typeId = o.getTypeId1();
|
||||||
String companyId = o.getCompanyId1();
|
String companyId = o.getCompanyId1();
|
||||||
|
|
||||||
String provinceid = o.getProvinceid();
|
String provinceid = o.getProvinceid();
|
||||||
String cityid = o.getCityid();
|
String cityid = o.getCityid();
|
||||||
String areaid = o.getAreaid();
|
String areaid = o.getAreaid();
|
||||||
if ("0".equals(typeId) || "0".equals(companyId)) {
|
if ("0".equals(typeId) || "0".equals(companyId)) {
|
||||||
ar.setFailMsg("请选择所属分公司或者工程类别");
|
ar.setFailMsg("请选择所属分公司或者工程类别");
|
||||||
} else if ("0".equals(provinceid)) {
|
} else if ("0".equals(provinceid)) {
|
||||||
ar.setFailMsg("请选择所在省");
|
ar.setFailMsg("请选择所在省");
|
||||||
} else if ("0".equals(cityid)) {
|
} else if ("0".equals(cityid)) {
|
||||||
ar.setFailMsg("请选择所在市");
|
ar.setFailMsg("请选择所在市");
|
||||||
} else if ("0".equals(areaid)) {
|
} else if ("0".equals(areaid)) {
|
||||||
ar.setFailMsg("请选择所在区");
|
ar.setFailMsg("请选择所在区");
|
||||||
} else {
|
} else {
|
||||||
pmService.update(o);
|
pmService.update(o);
|
||||||
ar.setSucceedMsg(GlobalConst.UPDATE_SUCCEED);
|
ar.setSucceedMsg(GlobalConst.UPDATE_SUCCEED);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.toString(), e);
|
logger.error(e.toString(), e);
|
||||||
ar.setFailMsg(GlobalConst.UPDATE_FAIL);
|
ar.setFailMsg(GlobalConst.UPDATE_FAIL);
|
||||||
}
|
}
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "find", method = RequestMethod.POST)
|
@RequestMapping(value = "find", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxRes find(ProjectManageBean o) {
|
public AjaxRes find(ProjectManageBean o) {
|
||||||
AjaxRes ar = getAjaxRes();
|
AjaxRes ar = getAjaxRes();
|
||||||
try {
|
try {
|
||||||
List<ProjectManageBean> list = pmService.find(o);
|
List<ProjectManageBean> list = pmService.find(o);
|
||||||
ar.setSucceed(list);
|
ar.setSucceed(list);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.toString(), e);
|
logger.error(e.toString(), e);
|
||||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||||
}
|
}
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "getProjectType", method = RequestMethod.POST)
|
@RequestMapping(value = "getProjectType", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxRes getProjectType() {
|
public AjaxRes getProjectType() {
|
||||||
AjaxRes ar = getAjaxRes();
|
AjaxRes ar = getAjaxRes();
|
||||||
try {
|
try {
|
||||||
List<ProjectManageBean> list = pmService.getProjectType();
|
List<ProjectManageBean> list = pmService.getProjectType();
|
||||||
Map<String, Object> p = new HashMap<String, Object>();
|
Map<String, Object> p = new HashMap<String, Object>();
|
||||||
p.put("list", list);
|
p.put("list", list);
|
||||||
ar.setSucceed(p);
|
ar.setSucceed(p);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.toString(), e);
|
logger.error(e.toString(), e);
|
||||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||||
}
|
}
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "getProjectName", method = RequestMethod.POST)
|
@RequestMapping(value = "getProjectName", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxRes getProjectName(ProjectManageBean o) {
|
public AjaxRes getProjectName(ProjectManageBean o) {
|
||||||
AjaxRes ar = getAjaxRes();
|
AjaxRes ar = getAjaxRes();
|
||||||
try {
|
try {
|
||||||
List<ProjectManageBean> list = pmService.getProjectName(o);
|
List<ProjectManageBean> list = pmService.getProjectName(o);
|
||||||
Map<String, Object> p = new HashMap<String, Object>();
|
Map<String, Object> p = new HashMap<String, Object>();
|
||||||
p.put("list", list);
|
p.put("list", list);
|
||||||
ar.setSucceed(p);
|
ar.setSucceed(p);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.toString(), e);
|
logger.error(e.toString(), e);
|
||||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||||
}
|
}
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "getVolLever", method = RequestMethod.POST)
|
@RequestMapping(value = "getVolLever", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxRes getVolLever() {
|
public AjaxRes getVolLever() {
|
||||||
AjaxRes ar = getAjaxRes();
|
AjaxRes ar = getAjaxRes();
|
||||||
try {
|
try {
|
||||||
List<ProjectManageBean> list = pmService.getVolLever();
|
List<ProjectManageBean> list = pmService.getVolLever();
|
||||||
Map<String, Object> p = new HashMap<String, Object>();
|
Map<String, Object> p = new HashMap<String, Object>();
|
||||||
p.put("list", list);
|
p.put("list", list);
|
||||||
ar.setSucceed(p);
|
ar.setSucceed(p);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.toString(), e);
|
logger.error(e.toString(), e);
|
||||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||||
}
|
}
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "findWorkTree", method = RequestMethod.POST)
|
@RequestMapping(value = "findWorkTree", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxRes roleTree() {
|
public AjaxRes roleTree() {
|
||||||
AjaxRes ar = getAjaxRes();
|
AjaxRes ar = getAjaxRes();
|
||||||
try {
|
try {
|
||||||
List<ZNode> list = pmService.findWorkTree();
|
List<ZNode> list = pmService.findWorkTree();
|
||||||
ar.setSucceed(list);
|
ar.setSucceed(list);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.toString(), e);
|
logger.error(e.toString(), e);
|
||||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||||
}
|
}
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "projectTree", method = RequestMethod.POST)
|
@RequestMapping(value = "projectTree", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxRes projectTree(ProjectManageBean o, HttpServletRequest req) {
|
public AjaxRes projectTree(ProjectManageBean o, HttpServletRequest req) {
|
||||||
AjaxRes ar = getAjaxRes();
|
AjaxRes ar = getAjaxRes();
|
||||||
try {
|
try {
|
||||||
List<ZNode> list = null;
|
List<ZNode> list = null;
|
||||||
if ("0".equals(o.getUnitId())) {
|
if ("0".equals(o.getUnitId())) {
|
||||||
list = pmService.projectTree(o);
|
list = pmService.projectTree(o);
|
||||||
} else {
|
} else {
|
||||||
if (StringHelper.isNotEmpty(o.getUnitId())) {
|
if (StringHelper.isNotEmpty(o.getUnitId())) {
|
||||||
list = pmService.projectTreeByUnitId(o);
|
list = pmService.projectTreeByUnitId(o);
|
||||||
} else {
|
} else {
|
||||||
list = pmService.projectTree(o);
|
list = pmService.projectTree(o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String isOpen = req.getParameter("isOpen");
|
String isOpen = req.getParameter("isOpen");
|
||||||
if (StringHelper.isNotEmpty(isOpen)) {
|
if (StringHelper.isNotEmpty(isOpen)) {
|
||||||
for (ZNode zNode : list) {
|
for (ZNode zNode : list) {
|
||||||
zNode.setOpen(true);
|
zNode.setOpen(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Map<String, Object> p = new HashMap<String, Object>();
|
Map<String, Object> p = new HashMap<String, Object>();
|
||||||
p.put("list", list);
|
p.put("list", list);
|
||||||
ar.setSucceed(p);
|
ar.setSucceed(p);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.toString(), e);
|
logger.error(e.toString(), e);
|
||||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||||
}
|
}
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "del", method = RequestMethod.POST)
|
@RequestMapping(value = "del", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxRes del(ProjectManageBean o) {
|
public AjaxRes del(ProjectManageBean o) {
|
||||||
AjaxRes ar = getAjaxRes();
|
AjaxRes ar = getAjaxRes();
|
||||||
try {
|
try {
|
||||||
pmService.delete(o);
|
pmService.delete(o);
|
||||||
ar.setSucceedMsg(GlobalConst.DEL_SUCCEED);
|
ar.setSucceedMsg(GlobalConst.DEL_SUCCEED);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.toString(), e);
|
logger.error(e.toString(), e);
|
||||||
ar.setFailMsg(GlobalConst.DEL_FAIL);
|
ar.setFailMsg(GlobalConst.DEL_FAIL);
|
||||||
}
|
}
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "getProvinces", method = RequestMethod.POST)
|
@RequestMapping(value = "getProvinces", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxRes getProvinces() {
|
public AjaxRes getProvinces() {
|
||||||
AjaxRes ar = getAjaxRes();
|
AjaxRes ar = getAjaxRes();
|
||||||
try {
|
try {
|
||||||
List<ProjectManageBean> list = pmService.getProvinces();
|
List<ProjectManageBean> list = pmService.getProvinces();
|
||||||
Map<String, Object> p = new HashMap<String, Object>();
|
Map<String, Object> p = new HashMap<String, Object>();
|
||||||
p.put("list", list);
|
p.put("list", list);
|
||||||
ar.setSucceed(p);
|
ar.setSucceed(p);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.toString(), e);
|
logger.error(e.toString(), e);
|
||||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||||
}
|
}
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "getCities", method = RequestMethod.POST)
|
@RequestMapping(value = "getCities", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxRes getCities(ProjectManageBean o) {
|
public AjaxRes getCities(ProjectManageBean o) {
|
||||||
AjaxRes ar = getAjaxRes();
|
AjaxRes ar = getAjaxRes();
|
||||||
try {
|
try {
|
||||||
List<ProjectManageBean> list = pmService.getCities(o);
|
List<ProjectManageBean> list = pmService.getCities(o);
|
||||||
Map<String, Object> p = new HashMap<String, Object>();
|
Map<String, Object> p = new HashMap<String, Object>();
|
||||||
p.put("list", list);
|
p.put("list", list);
|
||||||
ar.setSucceed(p);
|
ar.setSucceed(p);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.toString(), e);
|
logger.error(e.toString(), e);
|
||||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||||
}
|
}
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "getDistricts", method = RequestMethod.POST)
|
@RequestMapping(value = "getDistricts", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxRes getDistricts(ProjectManageBean o) {
|
public AjaxRes getDistricts(ProjectManageBean o) {
|
||||||
AjaxRes ar = getAjaxRes();
|
AjaxRes ar = getAjaxRes();
|
||||||
try {
|
try {
|
||||||
List<ProjectManageBean> list = pmService.getDistricts(o);
|
List<ProjectManageBean> list = pmService.getDistricts(o);
|
||||||
Map<String, Object> p = new HashMap<String, Object>();
|
Map<String, Object> p = new HashMap<String, Object>();
|
||||||
p.put("list", list);
|
p.put("list", list);
|
||||||
ar.setSucceed(p);
|
ar.setSucceed(p);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.toString(), e);
|
logger.error(e.toString(), e);
|
||||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||||
}
|
}
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,25 +12,31 @@ import com.bonus.sys.beans.ZNode;
|
||||||
@BonusBatis
|
@BonusBatis
|
||||||
public interface ProjectManageDao extends BaseDao<ProjectManageBean> {
|
public interface ProjectManageDao extends BaseDao<ProjectManageBean> {
|
||||||
|
|
||||||
List<ProjectManageBean> getVolLever();
|
List<ProjectManageBean> getVolLever();
|
||||||
|
|
||||||
List<ProjectManageBean> getProjectType();
|
List<ProjectManageBean> getProjectType();
|
||||||
|
|
||||||
public List<ZNode> findWorkTree();
|
public List<ZNode> findWorkTree();
|
||||||
|
|
||||||
List<ProjectManageBean> getProjectName(ProjectManageBean o);
|
List<ProjectManageBean> getProjectName(ProjectManageBean o);
|
||||||
|
|
||||||
List<ZNode> projectTree(ProjectManageBean o);
|
List<ZNode> projectTree(ProjectManageBean o);
|
||||||
|
|
||||||
List<ZNode> projectTreeByUnitId(ProjectManageBean o);
|
List<ZNode> projectTreeByUnitId(ProjectManageBean o);
|
||||||
|
|
||||||
ProjectManageBean findByName(String name);
|
ProjectManageBean findByName(String name);
|
||||||
|
|
||||||
List<ProjectManageBean> getProvinces();
|
List<ProjectManageBean> getProvinces();
|
||||||
|
|
||||||
List<ProjectManageBean> getCities(@Param("param") ProjectManageBean o);
|
List<ProjectManageBean> getCities(@Param("param") ProjectManageBean o);
|
||||||
|
|
||||||
List<ProjectManageBean> getDistricts(@Param("param") ProjectManageBean o);
|
List<ProjectManageBean> getDistricts(@Param("param") ProjectManageBean o);
|
||||||
|
|
||||||
int updateBidId(ProjectManageBean o);
|
void updateProject(@Param("num") String num, @Param("id") String id);
|
||||||
|
|
||||||
|
ProjectManageBean findByCode(String projectCode);
|
||||||
|
|
||||||
|
void updateProjectName(@Param("projectName")String projectName, @Param("projectCode")String projectCode);
|
||||||
|
|
||||||
|
int updateBidId(ProjectManageBean o);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,5 +28,12 @@ public interface ProjectManageService extends BaseService<ProjectManageBean> {
|
||||||
|
|
||||||
List<ProjectManageBean> getDistricts(ProjectManageBean o);
|
List<ProjectManageBean> getDistricts(ProjectManageBean o);
|
||||||
|
|
||||||
|
ProjectManageBean findByCode(String projectCode);
|
||||||
|
|
||||||
|
void updateProjectName(String projectName, String projectCode);
|
||||||
|
|
||||||
|
void updateProject(String num,String id);
|
||||||
|
|
||||||
|
|
||||||
int updateBidId(ProjectManageBean o);
|
int updateBidId(ProjectManageBean o);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,4 +85,5 @@ public class ProjectManageServiceImp extends BaseServiceImp<ProjectManageBean> i
|
||||||
public int updateBidId(ProjectManageBean o) {
|
public int updateBidId(ProjectManageBean o) {
|
||||||
return pmDao.updateBidId(o);
|
return pmDao.updateBidId(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue