机具库存收藏修改
This commit is contained in:
parent
037c8e3e69
commit
e767b6182c
|
|
@ -160,7 +160,8 @@
|
|||
LEFT JOIN bm_company bmc on bmc.ID = bmp.COMPANY_ID
|
||||
where bmp.ID=#{id}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<update id="update" parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
update bm_project
|
||||
<set>
|
||||
|
|
|
|||
|
|
@ -1,120 +1,125 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.bonus.bm.dao.ProjectManageDao" >
|
||||
<resultMap id="ZNode" type="com.bonus.sys.beans.ZNode"></resultMap>
|
||||
<mapper namespace="com.bonus.bm.dao.ProjectManageDao">
|
||||
<resultMap id="ZNode" type="com.bonus.sys.beans.ZNode"></resultMap>
|
||||
|
||||
<select id="findByPage" resultType="com.bonus.bm.beans.ProjectManageBean" parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
<select id="findByPage" resultType="com.bonus.bm.beans.ProjectManageBean"
|
||||
parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
select bmp.ID as id,bmp.`NAME` as name,bmp.COMPANY_ID as companyId,bmp.TIME as projectTime,
|
||||
bmc.`NAME` as companyName,bmp.TYPE_ID as typeId,bpt.`NAME` as typeName,
|
||||
bmp.VOL_ID as volId,bvl.`NAME` as volName,
|
||||
bmp.NUM as num,bmp.MANAGER as manager,bmp.NATURE as nature,
|
||||
bmp.TELPHONE as telphone,bmp.PHONE as phone,bmp.FAX as fax,
|
||||
bmp.ADDRESS as address,bmp.REMARKS as remarks,
|
||||
bmp.MATERIAL_CLERK as materialClerk,bmp.CLERK_PHONE as clerkPhone,
|
||||
bmp.IS_BALANCE_END as isBalanceEnd,
|
||||
bmp.KILOMETER as kilometer
|
||||
from bm_project bmp
|
||||
LEFT JOIN bm_vol_level bvl on bvl.ID = bmp.VOL_ID
|
||||
LEFT JOIN bm_project_type bpt on bmp.TYPE_ID = bpt.ID
|
||||
LEFT JOIN bm_company bmc on bmc.ID = bmp.COMPANY_ID
|
||||
where 1=1 and bmp.IS_ACTIVE=1 and bmp.IS_BALANCE_END=#{param.isBal}
|
||||
|
||||
<if test="param.companyId !=0 and param.companyId !='0'">
|
||||
and bmp.COMPANY_ID =#{param.companyId}
|
||||
</if>
|
||||
<if test="param.typeId !=0 and param.typeId !='0'">
|
||||
and bmp.TYPE_ID =#{param.typeId}
|
||||
</if>
|
||||
bmc.`NAME` as companyName,bmp.TYPE_ID as typeId,bpt.`NAME` as typeName,
|
||||
bmp.VOL_ID as volId,bvl.`NAME` as volName,
|
||||
bmp.NUM as num,bmp.MANAGER as manager,bmp.NATURE as nature,
|
||||
bmp.TELPHONE as telphone,bmp.PHONE as phone,bmp.FAX as fax,
|
||||
bmp.ADDRESS as address,bmp.REMARKS as remarks,
|
||||
bmp.MATERIAL_CLERK as materialClerk,bmp.CLERK_PHONE as clerkPhone,
|
||||
bmp.IS_BALANCE_END as isBalanceEnd,
|
||||
bmp.KILOMETER as kilometer
|
||||
from bm_project bmp
|
||||
LEFT JOIN bm_vol_level bvl on bvl.ID = bmp.VOL_ID
|
||||
LEFT JOIN bm_project_type bpt on bmp.TYPE_ID = bpt.ID
|
||||
LEFT JOIN bm_company bmc on bmc.ID = bmp.COMPANY_ID
|
||||
where 1=1 and bmp.IS_ACTIVE=1 and bmp.IS_BALANCE_END=#{param.isBal}
|
||||
|
||||
<if test="param.companyId !=0 and param.companyId !='0'">
|
||||
and bmp.COMPANY_ID =#{param.companyId}
|
||||
</if>
|
||||
<if test="param.typeId !=0 and param.typeId !='0'">
|
||||
and bmp.TYPE_ID =#{param.typeId}
|
||||
</if>
|
||||
<if test="param.keyWord !=null and param.keyWord !=''">
|
||||
and (
|
||||
bmp.NAME LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
bmp.NUM LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
bmp.MANAGER LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
bmp.NATURE LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
bmp.TELPHONE LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
bmp.MATERIAL_CLERK LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="param.startTime !='' and param.endTime =='' ">
|
||||
<![CDATA[
|
||||
and (
|
||||
bmp.NAME LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
bmp.NUM LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
bmp.MANAGER LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
bmp.NATURE LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
bmp.TELPHONE LIKE CONCAT('%',#{param.keyWord},'%') OR
|
||||
bmp.MATERIAL_CLERK LIKE CONCAT('%',#{param.keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="param.startTime !='' and param.endTime =='' ">
|
||||
<![CDATA[
|
||||
and bmp.TIME > #{param.startTime}
|
||||
]]>
|
||||
</if>
|
||||
<if test="param.startTime =='' and param.endTime !='' ">
|
||||
<![CDATA[
|
||||
</if>
|
||||
<if test="param.startTime =='' and param.endTime !='' ">
|
||||
<![CDATA[
|
||||
and bmp.TIME <#{param.endTime}
|
||||
]]>
|
||||
</if>
|
||||
<if test="param.startTime !='' and param.endTime !='' ">
|
||||
<![CDATA[
|
||||
</if>
|
||||
<if test="param.startTime !='' and param.endTime !='' ">
|
||||
<![CDATA[
|
||||
and ( bmp.TIME > #{param.startTime}
|
||||
and bmp.TIME < #{param.endTime}
|
||||
)
|
||||
]]>
|
||||
</if>
|
||||
ORDER BY bmp.TIME desc
|
||||
</if>
|
||||
ORDER BY bmp.TIME desc
|
||||
</select>
|
||||
<select id="getVolLever" resultType="com.bonus.bm.beans.ProjectManageBean" parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
SELECT bpt.ID,bpt.`NAME` from bm_vol_level bpt
|
||||
<select id="getVolLever" resultType="com.bonus.bm.beans.ProjectManageBean"
|
||||
parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
SELECT bpt.ID, bpt.`NAME`
|
||||
from bm_vol_level bpt
|
||||
</select>
|
||||
|
||||
<select id="getProjectType" resultType="com.bonus.bm.beans.ProjectManageBean" parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
SELECT bpt.ID,bpt.`NAME` from bm_project_type bpt
|
||||
|
||||
<select id="getProjectType" resultType="com.bonus.bm.beans.ProjectManageBean"
|
||||
parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
SELECT bpt.ID, bpt.`NAME`
|
||||
from bm_project_type bpt
|
||||
</select>
|
||||
|
||||
|
||||
<select id="findWorkTree" resultMap="ZNode">
|
||||
SELECT bmp.ID,bmp.`NAME`,bmp.TYPE_ID as pId
|
||||
FROM bm_project bmp
|
||||
LEFT JOIN bm_vol_level bvl ON bmp.TYPE_ID = bvl.ID
|
||||
WHERE bmp.IS_ACTIVE = '1'
|
||||
</select>
|
||||
|
||||
<select id="projectTree" resultMap="ZNode" parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
SELECT bmp.ID,bmp.`NAME`,concat('gs',bmp.COMPANY_ID) as pId
|
||||
FROM bm_project bmp
|
||||
left join bm_company bmc on bmc.ID = bmp.COMPANY_ID
|
||||
WHERE 1 = 1
|
||||
<if test="name != null and name != ''">
|
||||
and bmp.`NAME` LIKE CONCAT('%',#{name},'%')
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and bmp.`NAME` LIKE CONCAT('%',#{keyWord},'%')
|
||||
</if>
|
||||
union
|
||||
SELECT DISTINCT concat('gs',bmc.ID) as id,bmc.`NAME`,'0' as pId
|
||||
from bm_company bmc
|
||||
LEFT JOIN bm_project bmp on bmp.COMPANY_ID = bmc.ID
|
||||
WHERE bmp.ID is not NULL
|
||||
SELECT bmp.ID, bmp.`NAME`, bmp.TYPE_ID as pId
|
||||
FROM bm_project bmp
|
||||
LEFT JOIN bm_vol_level bvl ON bmp.TYPE_ID = bvl.ID
|
||||
WHERE bmp.IS_ACTIVE = '1'
|
||||
</select>
|
||||
|
||||
|
||||
<select id="projectTree" resultMap="ZNode" parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
SELECT bmp.ID,bmp.`NAME`,concat('gs',bmp.COMPANY_ID) as pId
|
||||
FROM bm_project bmp
|
||||
left join bm_company bmc on bmc.ID = bmp.COMPANY_ID
|
||||
WHERE 1 = 1
|
||||
<if test="name != null and name != ''">
|
||||
and bmp.`NAME` LIKE CONCAT('%',#{name},'%')
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and bmp.`NAME` LIKE CONCAT('%',#{keyWord},'%')
|
||||
</if>
|
||||
union
|
||||
SELECT DISTINCT concat('gs',bmc.ID) as id,bmc.`NAME`,'0' as pId
|
||||
from bm_company bmc
|
||||
LEFT JOIN bm_project bmp on bmp.COMPANY_ID = bmc.ID
|
||||
WHERE bmp.ID is not NULL
|
||||
</select>
|
||||
|
||||
<select id="projectTreeByUnitId" resultMap="ZNode" parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
SELECT a.*
|
||||
FROM (
|
||||
SELECT DISTINCT bmp.ID,bmp.`NAME`,concat('gs',bmp.COMPANY_ID) as pId
|
||||
FROM bm_project bmp
|
||||
left join bm_company bmc on bmc.ID = bmp.COMPANY_ID
|
||||
WHERE 1 = 1
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and bmp.`NAME` LIKE CONCAT('%',#{keyWord},'%')
|
||||
</if>
|
||||
union
|
||||
SELECT DISTINCT concat('gs',bmc.ID) as id,bmc.`NAME`,'0' as pId
|
||||
from bm_company bmc
|
||||
LEFT JOIN bm_project bmp on bmp.COMPANY_ID = bmc.ID
|
||||
WHERE bmp.ID is not NULL
|
||||
)a LEFT JOIN wf_lease_agreement bama on bama.PROJECT = a.ID
|
||||
WHERE bama.ID is not NULL
|
||||
<if test="unitId != null and unitId != '' ">
|
||||
and bama.LEASE_COMPANY = #{unitId}
|
||||
</if>
|
||||
<if test='isBalanceEnd == "0"'>
|
||||
and bama.IS_BALANCE = 1
|
||||
</if>
|
||||
<if test='isBalanceEnd == "1"'>
|
||||
and bama.IS_BALANCE = 0
|
||||
</if>
|
||||
SELECT a.*
|
||||
FROM (
|
||||
SELECT DISTINCT bmp.ID,bmp.`NAME`,concat('gs',bmp.COMPANY_ID) as pId
|
||||
FROM bm_project bmp
|
||||
left join bm_company bmc on bmc.ID = bmp.COMPANY_ID
|
||||
WHERE 1 = 1
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and bmp.`NAME` LIKE CONCAT('%',#{keyWord},'%')
|
||||
</if>
|
||||
union
|
||||
SELECT DISTINCT concat('gs',bmc.ID) as id,bmc.`NAME`,'0' as pId
|
||||
from bm_company bmc
|
||||
LEFT JOIN bm_project bmp on bmp.COMPANY_ID = bmc.ID
|
||||
WHERE bmp.ID is not NULL
|
||||
)a LEFT JOIN wf_lease_agreement bama on bama.PROJECT = a.ID
|
||||
WHERE bama.ID is not NULL
|
||||
<if test="unitId != null and unitId != '' ">
|
||||
and bama.LEASE_COMPANY = #{unitId}
|
||||
</if>
|
||||
<if test='isBalanceEnd == "0"'>
|
||||
and bama.IS_BALANCE = 1
|
||||
</if>
|
||||
<if test='isBalanceEnd == "1"'>
|
||||
and bama.IS_BALANCE = 0
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insert" parameterType="com.bonus.bm.beans.ProjectManageBean" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT into bm_project
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -170,7 +175,7 @@
|
|||
MATERIAL_CLERK,
|
||||
</if>
|
||||
<if test="kilometer != null">
|
||||
KILOMETER,
|
||||
KILOMETER,
|
||||
</if>
|
||||
<if test="clerkPhone !=null">
|
||||
CLERK_PHONE,
|
||||
|
|
@ -182,16 +187,16 @@
|
|||
<if test="name !=null">
|
||||
#{name},
|
||||
</if>
|
||||
<if test="num !=null">
|
||||
#{num},
|
||||
</if>
|
||||
<if test="num !=null">
|
||||
#{num},
|
||||
</if>
|
||||
<if test="companyId1 !=null">
|
||||
#{companyId1},
|
||||
</if>
|
||||
<if test="typeId1 !=null">
|
||||
#{typeId1},
|
||||
</if>
|
||||
|
||||
|
||||
<if test="provinceid !=null">
|
||||
#{provinceid},
|
||||
</if>
|
||||
|
|
@ -204,7 +209,7 @@
|
|||
<if test="detailed !=null">
|
||||
#{detailed},
|
||||
</if>
|
||||
|
||||
|
||||
<if test="manager !=null">
|
||||
#{manager},
|
||||
</if>
|
||||
|
|
@ -233,7 +238,7 @@
|
|||
#{materialClerk},
|
||||
</if>
|
||||
<if test="kilometer != null">
|
||||
#{kilometer},
|
||||
#{kilometer},
|
||||
</if>
|
||||
<if test="clerkPhone !=null">
|
||||
#{clerkPhone},
|
||||
|
|
@ -242,45 +247,46 @@
|
|||
NOW(),
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="find" resultType="com.bonus.bm.beans.ProjectManageBean" parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
select bmp.ID as id,bmp.`NAME` as name,bmp.COMPANY_ID as companyId,
|
||||
bmc.`NAME` as companyName,bmp.TYPE_ID as typeId,bpt.`NAME` as typeName,
|
||||
bmp.VOL_ID as volId,bvl.`NAME` as volName,
|
||||
bmp.NUM as num,bmp.MANAGER as manager,bmp.NATURE as nature,
|
||||
bmp.TELPHONE as telphone,bmp.PHONE as phone,bmp.FAX as fax,
|
||||
bmp.ADDRESS as address,bmp.REMARKS as remarks,
|
||||
bmp.MATERIAL_CLERK as materialClerk,bmp.CLERK_PHONE as clerkPhone,
|
||||
bmp.IS_BALANCE_END as isBalanceEnd,
|
||||
bmp.KILOMETER as kilometer, bmp.provinceid, bmp.cityid , bmp.areaid, bmp.detailed
|
||||
from bm_project bmp
|
||||
LEFT JOIN bm_vol_level bvl on bvl.ID = bmp.VOL_ID
|
||||
LEFT JOIN bm_project_type bpt on bmp.TYPE_ID = bpt.ID
|
||||
LEFT JOIN bm_company bmc on bmc.ID = bmp.COMPANY_ID
|
||||
where bmp.ID=#{id}
|
||||
<!-- <if test="name !=null">
|
||||
bmp.ID=#{id}
|
||||
</if>
|
||||
<if test="name !=null and name !='' ">
|
||||
and bmp.NAME=#{name}
|
||||
</if> -->
|
||||
<select id="find" resultType="com.bonus.bm.beans.ProjectManageBean"
|
||||
parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
select bmp.ID as id,bmp.`NAME` as name,bmp.COMPANY_ID as companyId,
|
||||
bmc.`NAME` as companyName,bmp.TYPE_ID as typeId,bpt.`NAME` as typeName,
|
||||
bmp.VOL_ID as volId,bvl.`NAME` as volName,
|
||||
bmp.NUM as num,bmp.MANAGER as manager,bmp.NATURE as nature,
|
||||
bmp.TELPHONE as telphone,bmp.PHONE as phone,bmp.FAX as fax,
|
||||
bmp.ADDRESS as address,bmp.REMARKS as remarks,
|
||||
bmp.MATERIAL_CLERK as materialClerk,bmp.CLERK_PHONE as clerkPhone,
|
||||
bmp.IS_BALANCE_END as isBalanceEnd,
|
||||
bmp.KILOMETER as kilometer, bmp.provinceid, bmp.cityid , bmp.areaid, bmp.detailed
|
||||
from bm_project bmp
|
||||
LEFT JOIN bm_vol_level bvl on bvl.ID = bmp.VOL_ID
|
||||
LEFT JOIN bm_project_type bpt on bmp.TYPE_ID = bpt.ID
|
||||
LEFT JOIN bm_company bmc on bmc.ID = bmp.COMPANY_ID
|
||||
where bmp.ID=#{id}
|
||||
<!-- <if test="name !=null">
|
||||
bmp.ID=#{id}
|
||||
</if>
|
||||
<if test="name !=null and name !='' ">
|
||||
and bmp.NAME=#{name}
|
||||
</if> -->
|
||||
</select>
|
||||
|
||||
|
||||
<update id="update" parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
update bm_project
|
||||
<set>
|
||||
<if test="name !=null">
|
||||
NAME=#{name},
|
||||
</if>
|
||||
<if test="num !=null">
|
||||
NUM=#{num},
|
||||
</if>
|
||||
<if test="companyId1 !=null">
|
||||
<if test="num !=null">
|
||||
NUM=#{num},
|
||||
</if>
|
||||
<if test="companyId1 !=null">
|
||||
COMPANY_ID =#{companyId1},
|
||||
</if>
|
||||
<if test="typeId1 !=null">
|
||||
TYPE_ID =#{typeId1},
|
||||
</if>
|
||||
|
||||
|
||||
<if test="provinceid !=null">
|
||||
provinceid = #{provinceid},
|
||||
</if>
|
||||
|
|
@ -311,7 +317,7 @@
|
|||
<if test="address !=null">
|
||||
ADDRESS=#{address},
|
||||
</if>
|
||||
<if test="volId1 !=null">
|
||||
<if test="volId1 !=null">
|
||||
VOL_ID = #{volId1},
|
||||
</if>
|
||||
<if test="remarks !=null">
|
||||
|
|
@ -321,7 +327,7 @@
|
|||
MATERIAL_CLERK=#{materialClerk},
|
||||
</if>
|
||||
<if test="kilometer != null">
|
||||
KILOMETER=#{kilometer},
|
||||
KILOMETER=#{kilometer},
|
||||
</if>
|
||||
<if test="clerkPhone !=null">
|
||||
CLERK_PHONE=#{clerkPhone},
|
||||
|
|
@ -329,38 +335,67 @@
|
|||
</set>
|
||||
where id=#{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="delete">
|
||||
update bm_project set IS_ACTIVE =0
|
||||
where ID =#{id}
|
||||
update bm_project
|
||||
set IS_ACTIVE =0
|
||||
where ID = #{id}
|
||||
</update>
|
||||
|
||||
<select id="getProjectName" resultType="com.bonus.bm.beans.ProjectManageBean" parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
SELECT ID,`NAME`
|
||||
FROM bm_project
|
||||
WHERE COMPANY_ID = #{companyId}
|
||||
<if test="typeId != null and typeId != ''">
|
||||
AND TYPE_ID = #{typeId}
|
||||
</if>
|
||||
<select id="findByCode" resultType="com.bonus.bm.beans.ProjectManageBean">
|
||||
SELECT ID, `NAME`
|
||||
FROM bm_project
|
||||
WHERE `NUM` = #{projectCode}
|
||||
</select>
|
||||
|
||||
<select id="findByName" resultType="com.bonus.bm.beans.ProjectManageBean">
|
||||
SELECT ID,`NAME`
|
||||
FROM bm_project
|
||||
WHERE `NAME` = #{name}
|
||||
<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="getProjectName" resultType="com.bonus.bm.beans.ProjectManageBean"
|
||||
parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
SELECT ID,`NAME`
|
||||
FROM bm_project
|
||||
WHERE COMPANY_ID = #{companyId}
|
||||
<if test="typeId != null and typeId != ''">
|
||||
AND TYPE_ID = #{typeId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<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 id="findByName" resultType="com.bonus.bm.beans.ProjectManageBean">
|
||||
SELECT ID, `NAME`
|
||||
FROM bm_project
|
||||
WHERE `NAME` = #{name}
|
||||
</select>
|
||||
|
||||
<select id="getCities" resultType="com.bonus.bm.beans.ProjectManageBean" parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
SELECT cityid as id, city as name FROM cities WHERE provinceid = #{param.provinceid} ORDER BY id
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
<select id="getDistricts" resultType="com.bonus.bm.beans.ProjectManageBean" parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
SELECT areaid as id, area as name FROM areas WHERE cityid = #{param.cityid} ORDER BY id
|
||||
|
||||
<select id="getCities" resultType="com.bonus.bm.beans.ProjectManageBean"
|
||||
parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
SELECT cityid as id, city as name
|
||||
FROM cities
|
||||
WHERE provinceid = #{param.provinceid}
|
||||
ORDER BY id
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getDistricts" resultType="com.bonus.bm.beans.ProjectManageBean"
|
||||
parameterType="com.bonus.bm.beans.ProjectManageBean">
|
||||
SELECT areaid as id, area as name
|
||||
FROM areas
|
||||
WHERE cityid = #{param.cityid}
|
||||
ORDER BY id
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -33,371 +33,363 @@ import com.bonus.sys.beans.ZNode;
|
|||
@RequestMapping("/backstage/project/")
|
||||
public class ProjectManageController extends BaseController<ProjectManageBean> {
|
||||
|
||||
// 16位KEY
|
||||
private static final String aesKey = "Z3PX8V9KJ2T7W4QN";
|
||||
// 密钥
|
||||
private static final String appSecret = "secret20250705";
|
||||
// appID
|
||||
private static final String allowAppId = "equipment";
|
||||
// 16位KEY
|
||||
private static final String aesKey = "Z3PX8V9KJ2T7W4QN";
|
||||
// 密钥
|
||||
private static final String appSecret = "secret20250705";
|
||||
// appID
|
||||
private static final String allowAppId = "equipment";
|
||||
|
||||
@Autowired
|
||||
private ProjectManageService pmService;
|
||||
@Autowired
|
||||
private ProjectManageService pmService;
|
||||
|
||||
@RequestMapping("list")
|
||||
public String index(Model model) {
|
||||
return "/bm/projectManage";
|
||||
}
|
||||
@RequestMapping("list")
|
||||
public String index(Model model) {
|
||||
return "/bm/projectManage";
|
||||
}
|
||||
|
||||
@RequestMapping("projectTree")
|
||||
public String unitTree(Model model) {
|
||||
return "/bm/projectTree";
|
||||
}
|
||||
@RequestMapping("projectTree")
|
||||
public String unitTree(Model model) {
|
||||
return "/bm/projectTree";
|
||||
}
|
||||
|
||||
/**
|
||||
* 与数创部同步工程信息,单次接收1条
|
||||
*/
|
||||
@RequestMapping(value = "syncProject", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes syncProject(@RequestBody JSONObject payload) {
|
||||
AjaxRes result = getAjaxRes();
|
||||
if (payload == null) {
|
||||
result.setFailMsg("同步错误,参数不能为空!");
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* 与数创部同步工程信息,单次接收1条
|
||||
*/
|
||||
@RequestMapping(value = "syncProject", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes syncProject(@RequestBody JSONObject payload) {
|
||||
AjaxRes result = getAjaxRes();
|
||||
if (payload == null) {
|
||||
result.setFailMsg("同步错误,参数不能为空!");
|
||||
return result;
|
||||
}
|
||||
|
||||
String appId = payload.getStr("appId");
|
||||
String timestamp = payload.getStr("timestamp");
|
||||
String encryptedData = payload.getStr("data");
|
||||
String sign = payload.getStr("sign");
|
||||
String appId = payload.getStr("appId");
|
||||
String timestamp = payload.getStr("timestamp");
|
||||
String encryptedData = payload.getStr("data");
|
||||
String sign = payload.getStr("sign");
|
||||
|
||||
// 1. 校验appId
|
||||
if (Objects.isNull(appId) || !allowAppId.equals(appId)) {
|
||||
result.setFailMsg("appId不匹配");
|
||||
return result;
|
||||
}
|
||||
// 1. 校验appId
|
||||
if (Objects.isNull(appId) || !allowAppId.equals(appId)) {
|
||||
result.setFailMsg("appId不匹配");
|
||||
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();
|
||||
if (!serverSign.equals(sign)) {
|
||||
result.setFailMsg("签名不合法!");
|
||||
return result;
|
||||
}
|
||||
|
||||
// 3. 验证签名
|
||||
String baseSign = appId + timestamp + encryptedData + appSecret;
|
||||
String serverSign = SecureUtil.sha256(baseSign).toUpperCase();
|
||||
if (!serverSign.equals(sign)) {
|
||||
result.setFailMsg("签名不合法!");
|
||||
return result;
|
||||
}
|
||||
// 4. 解密数据
|
||||
AES aes = SecureUtil.aes(aesKey.getBytes());
|
||||
String json = aes.decryptStr(encryptedData);
|
||||
JSONObject bizData = JSONUtil.parseObj(json);
|
||||
|
||||
// 4. 解密数据
|
||||
AES aes = SecureUtil.aes(aesKey.getBytes());
|
||||
String json = aes.decryptStr(encryptedData);
|
||||
JSONObject bizData = JSONUtil.parseObj(json);
|
||||
// 5. 业务处理
|
||||
String projectCode = bizData.getStr("projectCode");
|
||||
String projectName = bizData.getStr("projectName");
|
||||
String companyCode = bizData.getStr("companyCode");
|
||||
String typeCode = bizData.getStr("typeCode");
|
||||
String startDate = bizData.getStr("startDate", "");
|
||||
String status = bizData.getStr("status");
|
||||
|
||||
// 5. 业务处理
|
||||
String projectCode = bizData.getStr("projectCode");
|
||||
String projectName = bizData.getStr("projectName");
|
||||
String companyCode = bizData.getStr("companyCode");
|
||||
String typeCode = bizData.getStr("typeCode");
|
||||
String startDate = bizData.getStr("startDate", "");
|
||||
String status = bizData.getStr("status");
|
||||
// 6. 校验数据
|
||||
if (StrUtil.isBlank(projectCode) || StrUtil.isBlank(projectName) || StrUtil.isBlank(companyCode)
|
||||
|| StrUtil.isBlank(typeCode) || StrUtil.isBlank(status)) {
|
||||
System.err.println(projectCode + "," + projectName + "," + companyCode + "," + typeCode + "," + status + ","
|
||||
+ startDate);
|
||||
result.setFailMsg("数据不完整!!");
|
||||
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)
|
||||
|| 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;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "findByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes findByPage(Page<ProjectManageBean> page, ProjectManageBean o) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
if (ar.setNoAuth(doSecurityIntercept(GlobalConst.RESOURCES_TYPE_MENU, "/backstage/project/list"))) {
|
||||
try {
|
||||
if (o != null && !"".equals(o.getEndTime())) {
|
||||
String time = DateTimeHelper.getAddNumDay(o.getEndTime(), 1);
|
||||
o.setEndTime(time);
|
||||
}
|
||||
Page<ProjectManageBean> station = pmService.findByPage(o, page);
|
||||
Map<String, Object> p = new HashMap<String, Object>();
|
||||
p.put("list", station);
|
||||
ar.setSucceed(p);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
@RequestMapping(value = "findByPage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes findByPage(Page<ProjectManageBean> page, ProjectManageBean o) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
if (ar.setNoAuth(doSecurityIntercept(GlobalConst.RESOURCES_TYPE_MENU, "/backstage/project/list"))) {
|
||||
try {
|
||||
if (o != null && !"".equals(o.getEndTime())) {
|
||||
String time = DateTimeHelper.getAddNumDay(o.getEndTime(), 1);
|
||||
o.setEndTime(time);
|
||||
}
|
||||
Page<ProjectManageBean> station = pmService.findByPage(o, page);
|
||||
Map<String, Object> p = new HashMap<String, Object>();
|
||||
p.put("list", station);
|
||||
ar.setSucceed(p);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "insert", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes insert(ProjectManageBean o) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
ProjectManageBean bean = pmService.findByName(o.getName());
|
||||
if (bean == null) {
|
||||
String typeId = o.getTypeId1();
|
||||
String companyId = o.getCompanyId1();
|
||||
@RequestMapping(value = "insert", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes insert(ProjectManageBean o) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
ProjectManageBean bean = pmService.findByName(o.getName());
|
||||
if (bean == null) {
|
||||
String typeId = o.getTypeId1();
|
||||
String companyId = o.getCompanyId1();
|
||||
|
||||
String provinceid = o.getProvinceid();
|
||||
String cityid = o.getCityid();
|
||||
String areaid = o.getAreaid();
|
||||
if ("0".equals(typeId) || "0".equals(companyId)) {
|
||||
ar.setFailMsg("请选择所属分公司或者工程类别");
|
||||
} else if ("0".equals(provinceid)) {
|
||||
ar.setFailMsg("请选择所在省");
|
||||
} else if ("0".equals(cityid)) {
|
||||
ar.setFailMsg("请选择所在市");
|
||||
} else if ("0".equals(areaid)) {
|
||||
ar.setFailMsg("请选择所在区");
|
||||
} else {
|
||||
pmService.insert(o);
|
||||
ar.setSucceedMsg(GlobalConst.SAVE_SUCCEED);
|
||||
}
|
||||
} else {
|
||||
ar.setFailMsg("工程名称重复,请重新填写");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.SAVE_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
String provinceid = o.getProvinceid();
|
||||
String cityid = o.getCityid();
|
||||
String areaid = o.getAreaid();
|
||||
if ("0".equals(typeId) || "0".equals(companyId)) {
|
||||
ar.setFailMsg("请选择所属分公司或者工程类别");
|
||||
} else if ("0".equals(provinceid)) {
|
||||
ar.setFailMsg("请选择所在省");
|
||||
} else if ("0".equals(cityid)) {
|
||||
ar.setFailMsg("请选择所在市");
|
||||
} else if ("0".equals(areaid)) {
|
||||
ar.setFailMsg("请选择所在区");
|
||||
} else {
|
||||
pmService.insert(o);
|
||||
ar.setSucceedMsg(GlobalConst.SAVE_SUCCEED);
|
||||
}
|
||||
} else {
|
||||
ar.setFailMsg("工程名称重复,请重新填写");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.SAVE_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "update", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes update(ProjectManageBean o) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
@RequestMapping(value = "update", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes update(ProjectManageBean o) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
|
||||
String typeId = o.getTypeId1();
|
||||
String companyId = o.getCompanyId1();
|
||||
String typeId = o.getTypeId1();
|
||||
String companyId = o.getCompanyId1();
|
||||
|
||||
String provinceid = o.getProvinceid();
|
||||
String cityid = o.getCityid();
|
||||
String areaid = o.getAreaid();
|
||||
if ("0".equals(typeId) || "0".equals(companyId)) {
|
||||
ar.setFailMsg("请选择所属分公司或者工程类别");
|
||||
} else if ("0".equals(provinceid)) {
|
||||
ar.setFailMsg("请选择所在省");
|
||||
} else if ("0".equals(cityid)) {
|
||||
ar.setFailMsg("请选择所在市");
|
||||
} else if ("0".equals(areaid)) {
|
||||
ar.setFailMsg("请选择所在区");
|
||||
} else {
|
||||
pmService.update(o);
|
||||
ar.setSucceedMsg(GlobalConst.UPDATE_SUCCEED);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.UPDATE_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
String provinceid = o.getProvinceid();
|
||||
String cityid = o.getCityid();
|
||||
String areaid = o.getAreaid();
|
||||
if ("0".equals(typeId) || "0".equals(companyId)) {
|
||||
ar.setFailMsg("请选择所属分公司或者工程类别");
|
||||
} else if ("0".equals(provinceid)) {
|
||||
ar.setFailMsg("请选择所在省");
|
||||
} else if ("0".equals(cityid)) {
|
||||
ar.setFailMsg("请选择所在市");
|
||||
} else if ("0".equals(areaid)) {
|
||||
ar.setFailMsg("请选择所在区");
|
||||
} else {
|
||||
pmService.update(o);
|
||||
ar.setSucceedMsg(GlobalConst.UPDATE_SUCCEED);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.UPDATE_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "find", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes find(ProjectManageBean o) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<ProjectManageBean> list = pmService.find(o);
|
||||
ar.setSucceed(list);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
@RequestMapping(value = "find", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes find(ProjectManageBean o) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<ProjectManageBean> list = pmService.find(o);
|
||||
ar.setSucceed(list);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "getProjectType", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes getProjectType() {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<ProjectManageBean> list = pmService.getProjectType();
|
||||
Map<String, Object> p = new HashMap<String, Object>();
|
||||
p.put("list", list);
|
||||
ar.setSucceed(p);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
@RequestMapping(value = "getProjectType", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes getProjectType() {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<ProjectManageBean> list = pmService.getProjectType();
|
||||
Map<String, Object> p = new HashMap<String, Object>();
|
||||
p.put("list", list);
|
||||
ar.setSucceed(p);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "getProjectName", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes getProjectName(ProjectManageBean o) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<ProjectManageBean> list = pmService.getProjectName(o);
|
||||
Map<String, Object> p = new HashMap<String, Object>();
|
||||
p.put("list", list);
|
||||
ar.setSucceed(p);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
@RequestMapping(value = "getProjectName", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes getProjectName(ProjectManageBean o) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<ProjectManageBean> list = pmService.getProjectName(o);
|
||||
Map<String, Object> p = new HashMap<String, Object>();
|
||||
p.put("list", list);
|
||||
ar.setSucceed(p);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "getVolLever", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes getVolLever() {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<ProjectManageBean> list = pmService.getVolLever();
|
||||
Map<String, Object> p = new HashMap<String, Object>();
|
||||
p.put("list", list);
|
||||
ar.setSucceed(p);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
@RequestMapping(value = "getVolLever", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes getVolLever() {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<ProjectManageBean> list = pmService.getVolLever();
|
||||
Map<String, Object> p = new HashMap<String, Object>();
|
||||
p.put("list", list);
|
||||
ar.setSucceed(p);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "findWorkTree", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes roleTree() {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<ZNode> list = pmService.findWorkTree();
|
||||
ar.setSucceed(list);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
@RequestMapping(value = "findWorkTree", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes roleTree() {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<ZNode> list = pmService.findWorkTree();
|
||||
ar.setSucceed(list);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "projectTree", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes projectTree(ProjectManageBean o, HttpServletRequest req) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<ZNode> list = null;
|
||||
if ("0".equals(o.getUnitId())) {
|
||||
list = pmService.projectTree(o);
|
||||
} else {
|
||||
if (StringHelper.isNotEmpty(o.getUnitId())) {
|
||||
list = pmService.projectTreeByUnitId(o);
|
||||
} else {
|
||||
list = pmService.projectTree(o);
|
||||
}
|
||||
}
|
||||
String isOpen = req.getParameter("isOpen");
|
||||
if (StringHelper.isNotEmpty(isOpen)) {
|
||||
for (ZNode zNode : list) {
|
||||
zNode.setOpen(true);
|
||||
}
|
||||
}
|
||||
Map<String, Object> p = new HashMap<String, Object>();
|
||||
p.put("list", list);
|
||||
ar.setSucceed(p);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
@RequestMapping(value = "projectTree", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes projectTree(ProjectManageBean o, HttpServletRequest req) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<ZNode> list = null;
|
||||
if ("0".equals(o.getUnitId())) {
|
||||
list = pmService.projectTree(o);
|
||||
} else {
|
||||
if (StringHelper.isNotEmpty(o.getUnitId())) {
|
||||
list = pmService.projectTreeByUnitId(o);
|
||||
} else {
|
||||
list = pmService.projectTree(o);
|
||||
}
|
||||
}
|
||||
String isOpen = req.getParameter("isOpen");
|
||||
if (StringHelper.isNotEmpty(isOpen)) {
|
||||
for (ZNode zNode : list) {
|
||||
zNode.setOpen(true);
|
||||
}
|
||||
}
|
||||
Map<String, Object> p = new HashMap<String, Object>();
|
||||
p.put("list", list);
|
||||
ar.setSucceed(p);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "del", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes del(ProjectManageBean o) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
pmService.delete(o);
|
||||
ar.setSucceedMsg(GlobalConst.DEL_SUCCEED);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DEL_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
@RequestMapping(value = "del", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes del(ProjectManageBean o) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
pmService.delete(o);
|
||||
ar.setSucceedMsg(GlobalConst.DEL_SUCCEED);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DEL_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "getProvinces", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes getProvinces() {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<ProjectManageBean> list = pmService.getProvinces();
|
||||
Map<String, Object> p = new HashMap<String, Object>();
|
||||
p.put("list", list);
|
||||
ar.setSucceed(p);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
@RequestMapping(value = "getProvinces", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes getProvinces() {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<ProjectManageBean> list = pmService.getProvinces();
|
||||
Map<String, Object> p = new HashMap<String, Object>();
|
||||
p.put("list", list);
|
||||
ar.setSucceed(p);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "getCities", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes getCities(ProjectManageBean o) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<ProjectManageBean> list = pmService.getCities(o);
|
||||
Map<String, Object> p = new HashMap<String, Object>();
|
||||
p.put("list", list);
|
||||
ar.setSucceed(p);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
@RequestMapping(value = "getCities", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes getCities(ProjectManageBean o) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<ProjectManageBean> list = pmService.getCities(o);
|
||||
Map<String, Object> p = new HashMap<String, Object>();
|
||||
p.put("list", list);
|
||||
ar.setSucceed(p);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "getDistricts", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes getDistricts(ProjectManageBean o) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<ProjectManageBean> list = pmService.getDistricts(o);
|
||||
Map<String, Object> p = new HashMap<String, Object>();
|
||||
p.put("list", list);
|
||||
ar.setSucceed(p);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
@RequestMapping(value = "getDistricts", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes getDistricts(ProjectManageBean o) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<ProjectManageBean> list = pmService.getDistricts(o);
|
||||
Map<String, Object> p = new HashMap<String, Object>();
|
||||
p.put("list", list);
|
||||
ar.setSucceed(p);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,24 +12,31 @@ import com.bonus.sys.beans.ZNode;
|
|||
@BonusBatis
|
||||
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> getCities(@Param("param") ProjectManageBean o);
|
||||
|
||||
List<ProjectManageBean> getDistricts(@Param("param") ProjectManageBean o);
|
||||
List<ProjectManageBean> getProvinces();
|
||||
|
||||
List<ProjectManageBean> getCities(@Param("param") ProjectManageBean o);
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,10 +21,14 @@ public interface ProjectManageService extends BaseService<ProjectManageBean> {
|
|||
List<ZNode> projectTreeByUnitId(ProjectManageBean o);
|
||||
|
||||
ProjectManageBean findByName(String name);
|
||||
|
||||
void updateProject(String num,String id);
|
||||
List<ProjectManageBean> getProvinces();
|
||||
|
||||
List<ProjectManageBean> getCities(ProjectManageBean o);
|
||||
|
||||
List<ProjectManageBean> getDistricts(ProjectManageBean o);
|
||||
|
||||
ProjectManageBean findByCode(String projectCode);
|
||||
|
||||
void updateProjectName(String projectName, String projectCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,57 +13,72 @@ import com.bonus.sys.beans.ZNode;
|
|||
@Service("ProjectManageService")
|
||||
public class ProjectManageServiceImp extends BaseServiceImp<ProjectManageBean> implements ProjectManageService {
|
||||
|
||||
@Autowired
|
||||
private ProjectManageDao pmDao;
|
||||
@Autowired
|
||||
private ProjectManageDao pmDao;
|
||||
|
||||
@Override
|
||||
public List<ProjectManageBean> getVolLever() {
|
||||
return pmDao.getVolLever();
|
||||
}
|
||||
@Override
|
||||
public List<ProjectManageBean> getVolLever() {
|
||||
return pmDao.getVolLever();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectManageBean> getProjectType() {
|
||||
return pmDao.getProjectType();
|
||||
}
|
||||
@Override
|
||||
public List<ProjectManageBean> getProjectType() {
|
||||
return pmDao.getProjectType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZNode> findWorkTree() {
|
||||
return pmDao.findWorkTree();
|
||||
}
|
||||
@Override
|
||||
public List<ZNode> findWorkTree() {
|
||||
return pmDao.findWorkTree();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectManageBean> getProjectName(ProjectManageBean o) {
|
||||
return pmDao.getProjectName(o);
|
||||
}
|
||||
@Override
|
||||
public List<ProjectManageBean> getProjectName(ProjectManageBean o) {
|
||||
return pmDao.getProjectName(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZNode> projectTree(ProjectManageBean o) {
|
||||
return pmDao.projectTree(o);
|
||||
}
|
||||
@Override
|
||||
public List<ZNode> projectTree(ProjectManageBean o) {
|
||||
return pmDao.projectTree(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZNode> projectTreeByUnitId(ProjectManageBean o) {
|
||||
return pmDao.projectTreeByUnitId(o);
|
||||
}
|
||||
@Override
|
||||
public List<ZNode> projectTreeByUnitId(ProjectManageBean o) {
|
||||
return pmDao.projectTreeByUnitId(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProjectManageBean findByName(String name) {
|
||||
return pmDao.findByName(name);
|
||||
}
|
||||
@Override
|
||||
public ProjectManageBean findByName(String name) {
|
||||
return pmDao.findByName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectManageBean> getProvinces() {
|
||||
return pmDao.getProvinces();
|
||||
}
|
||||
@Override
|
||||
public void updateProject(String num, String id) {
|
||||
pmDao.updateProject(num, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectManageBean> getCities(ProjectManageBean o) {
|
||||
return pmDao.getCities(o);
|
||||
}
|
||||
@Override
|
||||
public List<ProjectManageBean> getProvinces() {
|
||||
return pmDao.getProvinces();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectManageBean> getDistricts(ProjectManageBean o) {
|
||||
return pmDao.getDistricts(o);
|
||||
}
|
||||
@Override
|
||||
public List<ProjectManageBean> getCities(ProjectManageBean o) {
|
||||
return pmDao.getCities(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectManageBean> getDistricts(ProjectManageBean o) {
|
||||
return pmDao.getDistricts(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProjectManageBean findByCode(String projectCode) {
|
||||
return pmDao.findByCode(projectCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProjectName(String projectName, String projectCode) {
|
||||
pmDao.updateProjectName(projectName, projectCode);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue