合同管理整改
This commit is contained in:
		
							parent
							
								
									16987ed624
								
							
						
					
					
						commit
						c01ed44303
					
				| 
						 | 
					@ -32,12 +32,12 @@ public class BmContractServiceImpl implements BmContractService {
 | 
				
			||||||
    public List<BmContract> list(BmContract bmContract) {
 | 
					    public List<BmContract> list(BmContract bmContract) {
 | 
				
			||||||
        bmContract.setOwnerCom(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
 | 
					        bmContract.setOwnerCom(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
 | 
				
			||||||
        List<BmContract> list = bmContractMapper.list(bmContract);
 | 
					        List<BmContract> list = bmContractMapper.list(bmContract);
 | 
				
			||||||
        for (BmContract contract : list) {
 | 
					    /*    for (BmContract contract : list) {
 | 
				
			||||||
            BmFileInfo bmFileInfo = new BmFileInfo();
 | 
					            BmFileInfo bmFileInfo = new BmFileInfo();
 | 
				
			||||||
            bmFileInfo.setModelId(Long.valueOf(contract.getId())).setTaskType(MaterialConstants.APPENDICES_OF_CONTRACT).setFileType(0L);
 | 
					            bmFileInfo.setModelId(Long.valueOf(contract.getId())).setTaskType(MaterialConstants.APPENDICES_OF_CONTRACT).setFileType(0L);
 | 
				
			||||||
            List<BmFileInfo> bmFileInfos = bmFileInfoMapper.selectBmFileInfoList(bmFileInfo);
 | 
					            List<BmFileInfo> bmFileInfos = bmFileInfoMapper.selectBmFileInfoList(bmFileInfo);
 | 
				
			||||||
            contract.setBmFileInfoList(bmFileInfos);
 | 
					            contract.setBmFileInfoList(bmFileInfos);
 | 
				
			||||||
        }
 | 
					        }*/
 | 
				
			||||||
        return list;
 | 
					        return list;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,7 +48,7 @@ public class BmContractServiceImpl implements BmContractService {
 | 
				
			||||||
        bmContract.setOwnerCom(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
 | 
					        bmContract.setOwnerCom(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
 | 
				
			||||||
        bmContract.setStatus(0);
 | 
					        bmContract.setStatus(0);
 | 
				
			||||||
        Integer add = bmContractMapper.add(bmContract);
 | 
					        Integer add = bmContractMapper.add(bmContract);
 | 
				
			||||||
        if (add > 0) {
 | 
					   /*     if (add > 0) {
 | 
				
			||||||
            if (bmContract.getBmFileInfoList().size() > 0) {
 | 
					            if (bmContract.getBmFileInfoList().size() > 0) {
 | 
				
			||||||
                for (BmFileInfo bmFileInfo : bmContract.getBmFileInfoList()) {
 | 
					                for (BmFileInfo bmFileInfo : bmContract.getBmFileInfoList()) {
 | 
				
			||||||
                    bmFileInfo.setModelId(Long.valueOf(bmContract.getId()));
 | 
					                    bmFileInfo.setModelId(Long.valueOf(bmContract.getId()));
 | 
				
			||||||
| 
						 | 
					@ -59,7 +59,7 @@ public class BmContractServiceImpl implements BmContractService {
 | 
				
			||||||
                    bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
 | 
					                    bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }*/
 | 
				
			||||||
        return add;
 | 
					        return add;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -68,7 +68,7 @@ public class BmContractServiceImpl implements BmContractService {
 | 
				
			||||||
        bmContract.setOwnerId(SecurityUtils.getLoginUser().getUserid());
 | 
					        bmContract.setOwnerId(SecurityUtils.getLoginUser().getUserid());
 | 
				
			||||||
        bmContract.setOwnerCom(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
 | 
					        bmContract.setOwnerCom(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
 | 
				
			||||||
        Integer edit = bmContractMapper.edit(bmContract);
 | 
					        Integer edit = bmContractMapper.edit(bmContract);
 | 
				
			||||||
        if (edit > 0) {
 | 
					  /*      if (edit > 0) {
 | 
				
			||||||
            if (bmContract.getBmFileInfoList().size() > 0) {
 | 
					            if (bmContract.getBmFileInfoList().size() > 0) {
 | 
				
			||||||
                BmFileInfo fileInfo = new BmFileInfo();
 | 
					                BmFileInfo fileInfo = new BmFileInfo();
 | 
				
			||||||
                fileInfo.setModelId(Long.valueOf(bmContract.getId())).setTaskType(MaterialConstants.APPENDICES_OF_CONTRACT).setFileType(0L);
 | 
					                fileInfo.setModelId(Long.valueOf(bmContract.getId())).setTaskType(MaterialConstants.APPENDICES_OF_CONTRACT).setFileType(0L);
 | 
				
			||||||
| 
						 | 
					@ -82,18 +82,18 @@ public class BmContractServiceImpl implements BmContractService {
 | 
				
			||||||
                    bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
 | 
					                    bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }*/
 | 
				
			||||||
        return edit;
 | 
					        return edit;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public Integer del(BmContract bmContract) {
 | 
					    public Integer del(BmContract bmContract) {
 | 
				
			||||||
        Integer del = bmContractMapper.del(bmContract);
 | 
					        Integer del = bmContractMapper.del(bmContract);
 | 
				
			||||||
        if (del > 0) {
 | 
					       /* if (del > 0) {
 | 
				
			||||||
            BmFileInfo fileInfo = new BmFileInfo();
 | 
					            BmFileInfo fileInfo = new BmFileInfo();
 | 
				
			||||||
            fileInfo.setModelId(Long.valueOf(bmContract.getId())).setTaskType(MaterialConstants.APPENDICES_OF_CONTRACT).setFileType(0L);
 | 
					            fileInfo.setModelId(Long.valueOf(bmContract.getId())).setTaskType(MaterialConstants.APPENDICES_OF_CONTRACT).setFileType(0L);
 | 
				
			||||||
            bmFileInfoMapper.deleteBmFileInfo(fileInfo);
 | 
					            bmFileInfoMapper.deleteBmFileInfo(fileInfo);
 | 
				
			||||||
        }
 | 
					        }*/
 | 
				
			||||||
        return del;
 | 
					        return del;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,13 +4,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
				
			||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 | 
					"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 | 
				
			||||||
<mapper namespace="com.bonus.material.contract.mapper.BmContractMapper">
 | 
					<mapper namespace="com.bonus.material.contract.mapper.BmContractMapper">
 | 
				
			||||||
    <insert id="add" useGeneratedKeys="true" keyProperty="id">
 | 
					    <insert id="add" useGeneratedKeys="true" keyProperty="id">
 | 
				
			||||||
        insert into bm_contract(contract_code, contract_name, status, create_time, owner_id, owner_com)
 | 
					        insert into bm_contract(contract_code, contract_name, status, create_time, owner_id, owner_com, content)
 | 
				
			||||||
        values(#{contractCode}, #{contractName}, #{status}, now(), #{ownerId}, #{ownerCom})
 | 
					        values(#{contractCode}, #{contractName}, #{status}, now(), #{ownerId}, #{ownerCom}, #{content})
 | 
				
			||||||
    </insert>
 | 
					    </insert>
 | 
				
			||||||
    <update id="edit">
 | 
					    <update id="edit">
 | 
				
			||||||
        update bm_contract set
 | 
					        update bm_contract set
 | 
				
			||||||
        <if test="contractName != null and contractName != ''">contract_name = #{contractName},</if>
 | 
					        <if test="contractName != null and contractName != ''">contract_name = #{contractName},</if>
 | 
				
			||||||
        <if test="status != null">status = #{status},</if>
 | 
					        <if test="status != null">status = #{status},</if>
 | 
				
			||||||
 | 
					        <if test="content != null and content !=''">content = #{content},</if>
 | 
				
			||||||
        owner_id = #{ownerId},
 | 
					        owner_id = #{ownerId},
 | 
				
			||||||
        owner_com = #{ownerCom},
 | 
					        owner_com = #{ownerCom},
 | 
				
			||||||
        update_time = now()
 | 
					        update_time = now()
 | 
				
			||||||
| 
						 | 
					@ -27,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
				
			||||||
    </delete>
 | 
					    </delete>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <select id="list" resultType="com.bonus.material.contract.domain.BmContract">
 | 
					    <select id="list" resultType="com.bonus.material.contract.domain.BmContract">
 | 
				
			||||||
        select id, contract_code as contractCode, contract_name as contractName, status, create_time as createTime, update_time as updateTime, owner_id as ownerId, owner_com as ownerCom from bm_contract
 | 
					        select id, content, contract_code as contractCode, contract_name as contractName, status, create_time as createTime, update_time as updateTime, owner_id as ownerId, owner_com as ownerCom from bm_contract
 | 
				
			||||||
        <where>
 | 
					        <where>
 | 
				
			||||||
            owner_com = #{ownerCom}
 | 
					            owner_com = #{ownerCom}
 | 
				
			||||||
            <if test="contractCode != null and contractCode != ''">
 | 
					            <if test="contractCode != null and contractCode != ''">
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue