Browse Source

[fix]销售管理:

客户报价
修改 审批时 时间类型和字符串类型转换异常问题。
修改业务主管审核不同意的条件
修改SysCustomerQuote的tostring()方法
新增createTime和createBy方法
新增客户报价列表为createTime倒叙排序
删除业务经理审批前端页面多个instanceId字段问题
dev
liuxiaoxu 5 months ago
parent
commit
f9d10f4420
  1. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java
  2. 73
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuote.java
  3. 10
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java
  4. 3
      ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml
  5. 1
      ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html

5
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java

@ -240,6 +240,7 @@ public class SysCustomerQuoteController extends BaseController
String processInstanceId = task.getProcessInstanceId(); String processInstanceId = task.getProcessInstanceId();
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
SysCustomerQuoteVo sysCustomerQuoteVo = sysCustomerQuoteService.selectSysCustomerQuoteById(new Long(processInstance.getBusinessKey())); SysCustomerQuoteVo sysCustomerQuoteVo = sysCustomerQuoteService.selectSysCustomerQuoteById(new Long(processInstance.getBusinessKey()));
sysCustomerQuoteVo.setTaskId(taskId);
mmap.put("formData", sysCustomerQuoteVo); mmap.put("formData", sysCustomerQuoteVo);
mmap.put("taskId", taskId); mmap.put("taskId", taskId);
String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1); String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1);
@ -264,7 +265,9 @@ public class SysCustomerQuoteController extends BaseController
@ModelAttribute("preloadObj") SysCustomerQuoteVo sysCustomerQuoteVo, HttpServletRequest request) { @ModelAttribute("preloadObj") SysCustomerQuoteVo sysCustomerQuoteVo, HttpServletRequest request) {
boolean saveEntityBoolean = BooleanUtils.toBoolean(saveEntity); boolean saveEntityBoolean = BooleanUtils.toBoolean(saveEntity);
sysCustomerQuoteVo.setSysCustomerQuoteChildList(JSON.parseArray(customerQuoteChildList, SysCustomerQuoteChild.class)); sysCustomerQuoteVo.setSysCustomerQuoteChildList(JSON.parseArray(customerQuoteChildList, SysCustomerQuoteChild.class));
String instanceId = sysCustomerQuoteVo.getInstanceId(); String instanceId = sysCustomerQuoteVo.getInstanceId();
String instanceType = sysCustomerQuoteVo.getInstanceType(); String instanceType = sysCustomerQuoteVo.getInstanceType();
boolean approvedFlag = processService.complete(taskId, instanceId, sysCustomerQuoteVo.getApplyTitle(), boolean approvedFlag = processService.complete(taskId, instanceId, sysCustomerQuoteVo.getApplyTitle(),
sysCustomerQuoteVo.getSupplierCode(), sysCustomerQuoteVo.getSupplierCode(),
@ -273,7 +276,7 @@ public class SysCustomerQuoteController extends BaseController
// 审核状态-审核拒绝 // 审核状态-审核拒绝
sysCustomerQuoteVo.setAuditStatus("2"); sysCustomerQuoteVo.setAuditStatus("2");
} }
// 如果任务已结束更新业务表状态 // 如果任务已结束更新业务表状态 方法中传入的值为原来的instanceId,只是做了调整
boolean processIsFinish = processService.judgeProcessIsFinish(instanceId); boolean processIsFinish = processService.judgeProcessIsFinish(instanceId);
if (processIsFinish) { if (processIsFinish) {
// 审核通过 // 审核通过

73
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomerQuote.java

@ -379,40 +379,45 @@ public class SysCustomerQuote extends BaseEntity
@Override @Override
public String toString() { public String toString() {
return Objects.toStringHelper(this) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.add("id", id) .append("id", getId())
.add("supplierCode", supplierCode) .append("supplierCode", getSupplierCode())
.add("customerCode", customerCode) .append("businessMembers", getBusinessMembers())
.add("customerName", customerName) .append("customerCode", getCustomerCode())
.add("pricingDate", pricingDate) .append("customerName", getCustomerName())
.add("enterprise", enterprise) .append("enterprise", getEnterprise())
.add("enterpriseSum", enterpriseSum) .append("pricingDate", getPricingDate())
.add("commonCurrency", commonCurrency) .append("enterpriseSum", getEnterpriseSum())
.add("confirmFax", confirmFax) .append("commonCurrency", getCommonCurrency())
.add("rmbTax", rmbTax) .append("usdTax", getUsdTax())
.add("usdTax", usdTax) .append("confirmFax", getConfirmFax())
.add("noRmbSum", noRmbSum) .append("noRmbSum", getNoRmbSum())
.add("noRmb", noRmb) .append("rmbTax", getRmbTax())
.add("rmb", rmb) .append("rmbSum", getRmbSum())
.add("rmbSum", rmbSum) .append("noUsdSum", getNoUsdSum())
.add("noUsd", noUsd) .append("usdSum", getUsdSum())
.add("noUsdSum", noUsdSum) .append("rmb", getRmb())
.add("usd", usd) .append("deginFlag", getDeginFlag())
.add("usdSum", usdSum) .append("noRmb", getNoRmb())
.add("businessMembers", businessMembers) .append("delFlag", getDelFlag())
.add("deginFlag", deginFlag) .append("createBy", getCreateBy())
.add("delFlag", delFlag) .append("noUsd", getNoUsd())
.add("auditStatus", auditStatus) .append("createTime", getCreateTime())
.add("useStatus", useStatus) .append("updateBy", getUpdateBy())
.add("applyUser", applyUser) .append("usd", getUsd())
.add("applyTime", applyTime) .append("updateTime", getUpdateTime())
.add("submitInstanceId", submitInstanceId) .append("remark", getRemark())
.add("applyTitle", applyTitle) .append("useStatus", getUseStatus())
.add("instanceId", instanceId) .append("auditStatus", getAuditStatus())
.add("instanceType", instanceType) .append("instanceId", getInstanceId())
.add("cancelInstanceId", cancelInstanceId) .append("instanceType", getInstanceType())
.add("restoreInstanceId", restoreInstanceId) .append("submitInstanceId", getSubmitInstanceId())
.add("sysCustomerQuoteChildList", sysCustomerQuoteChildList) .append("cancelInstanceId", getCancelInstanceId())
.append("restoreInstanceId", getRestoreInstanceId())
.append("applyTitle", getApplyTitle())
.append("applyUser", getApplyUser())
.append("applyTime", getApplyTime())
.append("sysCustomerQuoteChildList", getSysCustomerQuoteChildList())
.toString(); .toString();
} }
} }

10
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java

@ -141,11 +141,13 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
} }
for (SysCustomerQuoteChild sysCustomerQuoteChild : sysCustomerQuoteChildList) { for (SysCustomerQuoteChild sysCustomerQuoteChild : sysCustomerQuoteChildList) {
sysCustomerQuoteChild.setQuoteId(sysCustomerQuote.getSupplierCode()); sysCustomerQuoteChild.setQuoteId(sysCustomerQuote.getSupplierCode());
sysCustomerQuoteChild.setCreateTime(new Date());
sysCustomerQuoteChild.setCreateBy(loginName);
sysCustomerQuoteChildMapper.insertSysCustomerQuoteChild(sysCustomerQuoteChild); sysCustomerQuoteChildMapper.insertSysCustomerQuoteChild(sysCustomerQuoteChild);
} }
return result; return result;
} }
@Transactional(rollbackFor = Exception.class)
@Override @Override
public int updateSysCustomerQuote(SysCustomerQuoteVo sysCustomerQuote) { public int updateSysCustomerQuote(SysCustomerQuoteVo sysCustomerQuote) {
String loginName = ShiroUtils.getLoginName(); String loginName = ShiroUtils.getLoginName();
@ -279,6 +281,7 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
sysCustomerQuote.setApplyUser(user.getLoginName()); sysCustomerQuote.setApplyUser(user.getLoginName());
sysCustomerQuote.setApplyTime(DateUtils.getNowDate()); sysCustomerQuote.setApplyTime(DateUtils.getNowDate());
insertSysCustomerQuote(sysCustomerQuote); insertSysCustomerQuote(sysCustomerQuote);
System.out.println("sysCustomerQuote:"+sysCustomerQuote);
// 启动流程 // 启动流程
String applyTitle = user.getUserName()+"发起了客户报价信息提交审批-"+DateUtils.dateTimeNow(); String applyTitle = user.getUserName()+"发起了客户报价信息提交审批-"+DateUtils.dateTimeNow();
String instanceType = "submit"; String instanceType = "submit";
@ -310,7 +313,8 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
buildAuthority(user, variables); buildAuthority(user, variables);
sysCustomerQuote.setApplyTitle(applyTitle); sysCustomerQuote.setApplyTitle(applyTitle);
// 启动流程 // 启动流程
ProcessInstance processInstance = processService.submitApply(user.getLoginName(), businessKey, applyTitle, sysCustomerQuote.getSupplierCode(), key, variables); ProcessInstance processInstance = processService.submitApply(user.getLoginName(),
businessKey, applyTitle, sysCustomerQuote.getSupplierCode(), key, variables);
String processInstanceId = processInstance.getId(); String processInstanceId = processInstance.getId();
sysCustomerQuote.setInstanceId(processInstanceId); // 建立双向关系 sysCustomerQuote.setInstanceId(processInstanceId); // 建立双向关系
sysCustomerQuote.setInstanceType(instanceType); sysCustomerQuote.setInstanceType(instanceType);
@ -320,7 +324,7 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
private void buildAuthority(SysUser user, Map<String, Object> variables) { private void buildAuthority(SysUser user, Map<String, Object> variables) {
Set<String> roleKeys = roleService.selectRoleKeys(user.getUserId()); Set<String> roleKeys = roleService.selectRoleKeys(user.getUserId());
// 角色不同审核人不同 // 角色不同审核人不同
if(roleKeys.contains("zozjRole")){ if(roleKeys.contains("zozjRole") || roleKeys.contains("admin") || roleKeys.contains("zjlRole")){
variables.put("authority",4); variables.put("authority",4);
}else if(roleKeys.contains("ywzgRole")){ }else if(roleKeys.contains("ywzgRole")){
variables.put("authority",3); variables.put("authority",3);

3
ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml

@ -90,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and s.create_time between #{params.beginCreateTime} and #{params.endCreateTime} and s.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if> </if>
</where> </where>
order by s.create_time desc
</select> </select>
<select id="selectSysCustomerQuoteById" parameterType="Long" resultMap="SysCustomerQuoteResult"> <select id="selectSysCustomerQuoteById" parameterType="Long" resultMap="SysCustomerQuoteResult">
@ -216,7 +217,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyTitle != null">apply_title = #{applyTitle},</if> <if test="applyTitle != null">apply_title = #{applyTitle},</if>
<if test="applyUser != null">apply_user = #{applyUser},</if> <if test="applyUser != null">apply_user = #{applyUser},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if> <if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="updateTime != null and updateTime != ''" >update_time = #{updateTime},</if> <if test="updateTime != null" >update_time = #{updateTime},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

1
ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html

@ -9,7 +9,6 @@
<form class="form-horizontal m" id="form-customerQuote-ywjl" th:object="${formData}"> <form class="form-horizontal m" id="form-customerQuote-ywjl" th:object="${formData}">
<input name="id" th:field="*{id}" type="hidden"> <input name="id" th:field="*{id}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden"> <input name="taskId" th:field="*{taskId}" type="hidden">
<input type="hidden" th:field="*{instanceId}" name="instanceId" />
<input name="taskName" th:field="*{taskName}" type="hidden"> <input name="taskName" th:field="*{taskName}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden"> <input name="instanceId" th:field="*{instanceId}" type="hidden">
<input name="instanceType" th:field="*{instanceType}" type="hidden"> <input name="instanceType" th:field="*{instanceType}" type="hidden">

Loading…
Cancel
Save