机具库存收藏修改
This commit is contained in:
parent
5d6389bf3f
commit
79c3b3124d
|
|
@ -353,7 +353,21 @@
|
|||
WHERE `NAME` = #{name}
|
||||
</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 provinceid as id, province as name FROM provinces ORDER BY id
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -76,20 +76,6 @@ public class ProjectManageController extends BaseController<ProjectManageBean> {
|
|||
return result;
|
||||
}
|
||||
|
||||
// 2. 时间戳校验(防重放)
|
||||
// try {
|
||||
// Date time = DateUtil.parse(timestamp, "yyyyMMddHHmmss");
|
||||
// long diff = Math.abs(System.currentTimeMillis() - time.getTime());
|
||||
// if (diff > 5 * 60 * 1000) {
|
||||
// result.setFailMsg("请求时间戳不合法!!");
|
||||
// return result;
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// System.err.println("时间戳解析异常:" + timestamp + "," + e.getMessage());
|
||||
// result.setFailMsg("时间戳解析异常");
|
||||
// return result;
|
||||
// }
|
||||
|
||||
// 3. 验证签名
|
||||
String baseSign = appId + timestamp + encryptedData + appSecret;
|
||||
String serverSign = SecureUtil.sha256(baseSign).toUpperCase();
|
||||
|
|
@ -119,9 +105,11 @@ public class ProjectManageController extends BaseController<ProjectManageBean> {
|
|||
result.setFailMsg("数据不完整!!");
|
||||
return result;
|
||||
} else {
|
||||
ProjectManageBean beanCode = pmService.findByCode(projectCode);
|
||||
if (beanCode == null) {
|
||||
ProjectManageBean findBean = pmService.findByName(projectName);
|
||||
if (findBean != null) {
|
||||
System.out.println("工程名称已存在,跳过处理!");
|
||||
pmService.updateProject(projectCode, String.valueOf(findBean.getId()));
|
||||
result.setFailMsg("工程名称已存在,跳过处理!");
|
||||
} else {
|
||||
ProjectManageBean bean = new ProjectManageBean();
|
||||
|
|
@ -140,6 +128,10 @@ public class ProjectManageController extends BaseController<ProjectManageBean> {
|
|||
result.setFailMsg(projectName + "----工程信息同步失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pmService.updateProjectName(projectName, projectCode);
|
||||
}
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
@ -189,10 +181,6 @@ public class ProjectManageController extends BaseController<ProjectManageBean> {
|
|||
ar.setFailMsg("请选择所在区");
|
||||
} else {
|
||||
pmService.insert(o);
|
||||
//塞入bid_id
|
||||
if (o.getId()!=null){
|
||||
pmService.updateBidId(o);
|
||||
}
|
||||
ar.setSucceedMsg(GlobalConst.SAVE_SUCCEED);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -32,5 +32,11 @@ public interface ProjectManageDao extends BaseDao<ProjectManageBean> {
|
|||
|
||||
List<ProjectManageBean> getDistricts(@Param("param") 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);
|
||||
|
||||
ProjectManageBean findByCode(String projectCode);
|
||||
|
||||
void updateProjectName(String projectName, String projectCode);
|
||||
|
||||
void updateProject(String num,String id);
|
||||
|
||||
|
||||
int updateBidId(ProjectManageBean o);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,4 +85,5 @@ public class ProjectManageServiceImp extends BaseServiceImp<ProjectManageBean> i
|
|||
public int updateBidId(ProjectManageBean o) {
|
||||
return pmDao.updateBidId(o);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue