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

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

@ -379,40 +379,45 @@ public class SysCustomerQuote extends BaseEntity
@Override
public String toString() {
return Objects.toStringHelper(this)
.add("id", id)
.add("supplierCode", supplierCode)
.add("customerCode", customerCode)
.add("customerName", customerName)
.add("pricingDate", pricingDate)
.add("enterprise", enterprise)
.add("enterpriseSum", enterpriseSum)
.add("commonCurrency", commonCurrency)
.add("confirmFax", confirmFax)
.add("rmbTax", rmbTax)
.add("usdTax", usdTax)
.add("noRmbSum", noRmbSum)
.add("noRmb", noRmb)
.add("rmb", rmb)
.add("rmbSum", rmbSum)
.add("noUsd", noUsd)
.add("noUsdSum", noUsdSum)
.add("usd", usd)
.add("usdSum", usdSum)
.add("businessMembers", businessMembers)
.add("deginFlag", deginFlag)
.add("delFlag", delFlag)
.add("auditStatus", auditStatus)
.add("useStatus", useStatus)
.add("applyUser", applyUser)
.add("applyTime", applyTime)
.add("submitInstanceId", submitInstanceId)
.add("applyTitle", applyTitle)
.add("instanceId", instanceId)
.add("instanceType", instanceType)
.add("cancelInstanceId", cancelInstanceId)
.add("restoreInstanceId", restoreInstanceId)
.add("sysCustomerQuoteChildList", sysCustomerQuoteChildList)
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("supplierCode", getSupplierCode())
.append("businessMembers", getBusinessMembers())
.append("customerCode", getCustomerCode())
.append("customerName", getCustomerName())
.append("enterprise", getEnterprise())
.append("pricingDate", getPricingDate())
.append("enterpriseSum", getEnterpriseSum())
.append("commonCurrency", getCommonCurrency())
.append("usdTax", getUsdTax())
.append("confirmFax", getConfirmFax())
.append("noRmbSum", getNoRmbSum())
.append("rmbTax", getRmbTax())
.append("rmbSum", getRmbSum())
.append("noUsdSum", getNoUsdSum())
.append("usdSum", getUsdSum())
.append("rmb", getRmb())
.append("deginFlag", getDeginFlag())
.append("noRmb", getNoRmb())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("noUsd", getNoUsd())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("usd", getUsd())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("useStatus", getUseStatus())
.append("auditStatus", getAuditStatus())
.append("instanceId", getInstanceId())
.append("instanceType", getInstanceType())
.append("submitInstanceId", getSubmitInstanceId())
.append("cancelInstanceId", getCancelInstanceId())
.append("restoreInstanceId", getRestoreInstanceId())
.append("applyTitle", getApplyTitle())
.append("applyUser", getApplyUser())
.append("applyTime", getApplyTime())
.append("sysCustomerQuoteChildList", getSysCustomerQuoteChildList())
.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) {
sysCustomerQuoteChild.setQuoteId(sysCustomerQuote.getSupplierCode());
sysCustomerQuoteChild.setCreateTime(new Date());
sysCustomerQuoteChild.setCreateBy(loginName);
sysCustomerQuoteChildMapper.insertSysCustomerQuoteChild(sysCustomerQuoteChild);
}
return result;
}
@Transactional(rollbackFor = Exception.class)
@Override
public int updateSysCustomerQuote(SysCustomerQuoteVo sysCustomerQuote) {
String loginName = ShiroUtils.getLoginName();
@ -279,6 +281,7 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
sysCustomerQuote.setApplyUser(user.getLoginName());
sysCustomerQuote.setApplyTime(DateUtils.getNowDate());
insertSysCustomerQuote(sysCustomerQuote);
System.out.println("sysCustomerQuote:"+sysCustomerQuote);
// 启动流程
String applyTitle = user.getUserName()+"发起了客户报价信息提交审批-"+DateUtils.dateTimeNow();
String instanceType = "submit";
@ -310,7 +313,8 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
buildAuthority(user, variables);
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();
sysCustomerQuote.setInstanceId(processInstanceId); // 建立双向关系
sysCustomerQuote.setInstanceType(instanceType);
@ -320,7 +324,7 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
private void buildAuthority(SysUser user, Map<String, Object> variables) {
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);
}else if(roleKeys.contains("ywzgRole")){
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}
</if>
</where>
order by s.create_time desc
</select>
<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="applyUser != null">apply_user = #{applyUser},</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>
where id = #{id}
</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}">
<input name="id" th:field="*{id}" 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="instanceId" th:field="*{instanceId}" type="hidden">
<input name="instanceType" th:field="*{instanceType}" type="hidden">

Loading…
Cancel
Save