add 普通,工作组,资料网员编辑时修改邮寄信息中关联的联系人

This commit is contained in:
lijiarao
2022-08-11 14:55:15 +08:00
parent 305de4cb9b
commit e19208f6b5
7 changed files with 134 additions and 4 deletions
@@ -10,7 +10,7 @@ import com.jero.company.entity.PayContactsManagement;
import com.jero.mail.PayMailBillVO;
import com.jero.mail.entity.PayMailBill;
import com.jero.mail.entity.PayMailBillSearch;
import io.lettuce.core.dynamic.annotation.Param;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
@@ -51,7 +51,7 @@ public interface PayMailBillMapper extends BaseMapper<PayMailBill> {
* @return
*/
IPage<PayMailBill> pageList(Page<PayMailBill> page, @org.apache.ibatis.annotations.Param(Constants.WRAPPER) QueryWrapper<PayMailBill> queryWrapper);
IPage<PayMailBill> pageList(Page<PayMailBill> page, @Param(Constants.WRAPPER) QueryWrapper<PayMailBill> queryWrapper);
List<PayMailBill> pageListss(@Param("payMailBillSearch") PayMailBillSearch payMailBillSearch);
@@ -73,4 +73,6 @@ public interface PayMailBillMapper extends BaseMapper<PayMailBill> {
PayContactsManagement print(@Param("id") String id);
Integer updateByProjectId(@Param("updated") PayMailBill payMailBill, @Param("projectId") String projectId);
}
@@ -1,6 +1,25 @@
<?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.jero.mail.mapper.PayMailBillMapper">
<sql id="Base_Column_List">
id,
create_by,
create_time,
update_by,
update_time,
bill_no,
invoice_amount,
post_status,
send_method,
post_no,
contact_id,
contact_name,
contact_mobile,
bill_date,
send_date,
remark,
project_name
</sql>
<resultMap id="MailBillVO" type="com.jero.mail.entity.PayMailBill">
<result property="id" column="id"></result>
<result property="createBy" column="create_by"></result>
@@ -149,5 +168,68 @@
</where>
</select>
<!--auto generated by MybatisCodeHelper on 2022-08-11-->
<update id="updateByProjectId">
update pay_mail_bill
<set>
<if test="updated.id != null and updated.id != ''">
id = #{updated.id},
</if>
<if test="updated.createBy != null and updated.createBy != ''">
create_by = #{updated.createBy},
</if>
<if test="updated.createTime != null">
create_time = #{updated.createTime},
</if>
<if test="updated.updateBy != null and updated.updateBy != ''">
update_by = #{updated.updateBy},
</if>
<if test="updated.updateTime != null">
update_time = #{updated.updateTime},
</if>
<if test="updated.billNo != null and updated.billNo != ''">
bill_no = #{updated.billNo},
</if>
<if test="updated.invoiceAmount != null">
invoice_amount = #{updated.invoiceAmount},
</if>
<if test="updated.postStatus != null">
post_status = #{updated.postStatus},
</if>
<if test="updated.sendMethod != null">
send_method = #{updated.sendMethod},
</if>
<if test="updated.postNo != null and updated.postNo != ''">
post_no = #{updated.postNo},
</if>
<if test="updated.contactId != null and updated.contactId != ''">
contact_id = #{updated.contactId},
</if>
<if test="updated.contactName != null and updated.contactName != ''">
contact_name = #{updated.contactName},
</if>
<if test="updated.contactMobile != null and updated.contactMobile != ''">
contact_mobile = #{updated.contactMobile},
</if>
<if test="updated.billDate != null">
bill_date = #{updated.billDate},
</if>
<if test="updated.sendDate != null">
send_date = #{updated.sendDate},
</if>
<if test="updated.remark != null and updated.remark != ''">
remark = #{updated.remark},
</if>
<if test="updated.projectName != null and updated.projectName != ''">
project_name = #{updated.projectName},
</if>
</set>
<where>
id in (
select bill_id
from pay_mail_bill_project
where project_id = #{projectId}
)
</where>
</update>
</mapper>
@@ -88,4 +88,11 @@ public interface IPayMailBillService extends IService<PayMailBill> {
PayContactsManagement print(String id);
/**
* 如果有邮寄信息更新邮寄联系人信息
* @param ContactId 邮寄联系人id
* @param projectId 项目id
*/
void updateContactByProjectId(String ContactId,String projectId);
}
@@ -565,6 +565,23 @@ public class PayMailBillServiceImpl extends ServiceImpl<PayMailBillMapper, PayMa
return payMailBillMapper.print(id);
}
@Override
public void updateContactByProjectId(String ContactId, String projectId) {
PayContactsManagement contact= payContactsManagementMapper.selectById(ContactId);
if (contact == null){
return;
}
PayMailBill payMailBill = new PayMailBill();
payMailBill.setContactId(ContactId);
payMailBill.setContactName(contact.getName());
payMailBill.setContactMobile(contact.getPhone());
payMailBill.setEmail(contact.getEmail());
payMailBill.setPostalCode(contact.getPostalCode());
payMailBill.setContactAddress(contact.getContactAddress());
payMailBillMapper.updateByProjectId(payMailBill,projectId);
}
//校验不同项目是否属于同一个公司,开票金额是否大于当前未开票金额,企业名称是否审核
private String checkCompanyProject(List<PayMailBillProject> bmpList) {
@@ -20,6 +20,7 @@ import com.jero.company.entity.PayContactsManagement;
import com.jero.company.service.IPayContactsManagementService;
import com.jero.contract.entity.PayIncomeContract;
import com.jero.contract.service.IPayIncomeContractService;
import com.jero.mail.service.IPayMailBillService;
import com.jero.member.entity.PayMemberProject;
import com.jero.member.entity.PayMemberProjectSubitem;
import com.jero.member.mapper.PayMemberProjectMapper;
@@ -77,6 +78,8 @@ public class PayPayMemberProjectSubitemServiceImpl extends ServiceImpl<PayMember
private RolePermissionService rolePermissionService;
@Resource
private PayMemberProjectMapper payMemberProjectMapper;
@Resource
private IPayMailBillService payMailBillService;
/**
* 保存
*/
@@ -247,6 +250,9 @@ public class PayPayMemberProjectSubitemServiceImpl extends ServiceImpl<PayMember
}
validMemberProjectSubitemEdit(payMemberProjectSubitem,payMemberProjectSubitem1);
saveOrUpdate(payMemberProjectSubitem);
// 如果有邮寄信息更新邮寄联系人信息
String mailContactsId = payMemberProjectSubitem.getPostContactId();
payMailBillService.updateContactByProjectId(mailContactsId,payMemberProjectSubitem.getId());
}
/**
@@ -16,11 +16,17 @@ import com.jero.common.service.RolePermissionService;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.vo.ProjectStatusVO;
import com.jero.company.entity.PayContactsManagement;
import com.jero.company.mapper.PayContactsManagementMapper;
import com.jero.company.service.IPayContactsManagementService;
import com.jero.contract.entity.PayIncomeContract;
import com.jero.contract.entity.PayIncomeContractAssociated;
import com.jero.contract.service.IPayIncomeContractAssociatedService;
import com.jero.contract.service.IPayIncomeContractService;
import com.jero.mail.entity.PayMailBill;
import com.jero.mail.entity.PayMailBillProject;
import com.jero.mail.mapper.PayMailBillMapper;
import com.jero.mail.service.IPayMailBillProjectService;
import com.jero.mail.service.IPayMailBillService;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysUserService;
import com.jero.pack.entity.PayPackCompanyProject;
@@ -81,7 +87,8 @@ public class PayCommonProjectServiceImpl extends ServiceImpl<PayCommonProjectMap
private RolePermissionService rolePermissionService;
@Resource
private IPayPaymentCheckService payPaymentCheckService;
@Resource
private IPayMailBillService payMailBillService;
@@ -256,6 +263,9 @@ public class PayCommonProjectServiceImpl extends ServiceImpl<PayCommonProjectMap
updatePayCommonProject.set(PayCommonProject::getContractNum,null);
}
payCommonProjectService.update(updatePayCommonProject);
// 如果有邮寄信息更新邮寄联系人信息
String mailContactsId = payCommonProject.getMailContactsId();
payMailBillService.updateContactByProjectId(mailContactsId,payCommonProject.getId());
}
@@ -28,6 +28,7 @@ import com.jero.contract.entity.PayIncomeContract;
import com.jero.contract.entity.PayIncomeContractAssociated;
import com.jero.contract.service.IPayIncomeContractAssociatedService;
import com.jero.contract.service.IPayIncomeContractService;
import com.jero.mail.service.IPayMailBillService;
import com.jero.meeting.entity.PayMeetingRemindRecord;
import com.jero.meeting.service.IPayMeetingRemindRecordService;
import com.jero.modules.oss.entity.OSSFile;
@@ -119,6 +120,8 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
private IPayWorkingGroupSubItemContactsService payWorkingGroupSubItemContactsService;
@Resource
private Environment env;
@Resource
private IPayMailBillService payMailBillService;
@Override
@@ -482,6 +485,9 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
updatePayWorkingGroupSubItem.set(PayWorkingGroupSubItem::getContractNum,null);
}
payWorkingGroupSubItemService.update(updatePayWorkingGroupSubItem);
// 如果有邮寄信息更新邮寄联系人信息
String mailContactsId = payWorkingGroupSubItem.getMailContactsId();
payMailBillService.updateContactByProjectId(mailContactsId,payWorkingGroupSubItem.getId());
}
@Override