Browse Source

添加出库退回功能

lwx_dev
erdanergou 2 years ago
parent
commit
44ad96a169
  1. 21
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java
  2. 3
      src/main/java/com/dreamchaser/depository_manage/controller/QyWxOperationController.java
  3. 10
      src/main/java/com/dreamchaser/depository_manage/depository_mapper/DepositoryRecordMapper.java
  4. 10
      src/main/java/com/dreamchaser/depository_manage/depository_mapper/DepositoryRecordMapper.xml
  5. 9
      src/main/java/com/dreamchaser/depository_manage/service/DepositoryRecordService.java
  6. 210
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  7. 49
      src/main/resources/application-prod.yml
  8. 46
      src/main/resources/templates/pages/depository/table-out.html
  9. 15
      src/test/java/com/dreamchaser/depository_manage/SomeTest.java

21
src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java

@ -1353,7 +1353,26 @@ public class DepositoryRecordController {
} }
} }
// // 退回出库子单
@PostMapping("/refundedApplicationOutRecordMin")
public RestResponse refundedApplicationOutRecordMin(@RequestBody Map<String, Object> map, HttpServletRequest request) {
if (map.containsKey("id")) {
String token = request.getHeader("user-token");
String userKey = request.getHeader("user-key");
if (token == null) {
token = (String) request.getSession().getAttribute("userToken");
userKey = (String) request.getSession().getAttribute("userKey");
}
UserByPort userByPort = AuthenticationTokenPool.getUserToken(token);
String header = request.getHeader("user-agent");
String crypt = Md5.crypt(header);
Long id = ObjectFormatUtil.toLong(map.get("id"));
return CrudUtil.deleteHandle(depositoryRecordService.refundedApplicationOutRecordMinById(id, userByPort, crypt, userKey, token), 1);
} else {
throw new MyException("所需请求参数缺失!");
}
}
// 用于判断该记录是否正在运行 // 用于判断该记录是否正在运行
@PostMapping("/judgeApplicationOutRecordStatus") @PostMapping("/judgeApplicationOutRecordStatus")

3
src/main/java/com/dreamchaser/depository_manage/controller/QyWxOperationController.java

@ -632,6 +632,9 @@ public class QyWxOperationController {
// 获取当前的主订单 // 获取当前的主订单
ApplicationOutRecordP applicationOutRecordPById = depositoryRecordService.findApplicationOutRecordPById(ObjectFormatUtil.toLong(mainId)); ApplicationOutRecordP applicationOutRecordPById = depositoryRecordService.findApplicationOutRecordPById(ObjectFormatUtil.toLong(mainId));
if(applicationOutRecordPById == null){
return;
}
if (Integer.compare(applicationOutRecordPById.getFlagForOpenDepository(), 2) == 0) { if (Integer.compare(applicationOutRecordPById.getFlagForOpenDepository(), 2) == 0) {
// 如果是申请的开放仓库 // 如果是申请的开放仓库

10
src/main/java/com/dreamchaser/depository_manage/depository_mapper/DepositoryRecordMapper.java

@ -441,6 +441,14 @@ public interface DepositoryRecordMapper {
* @param id * @param id
* @return 受影响的行数 * @return 受影响的行数
*/ */
Integer deleteApplicationOutRecordMinByParentId(Long id);
/**
* 根据id删除子单
* @param id
* @return
*/
Integer deleteApplicationOutRecordMinById(Long id); Integer deleteApplicationOutRecordMinById(Long id);
@ -459,7 +467,7 @@ public interface DepositoryRecordMapper {
* @param list id集合 * @param list id集合
* @return 受影响的行数 * @return 受影响的行数
*/ */
Integer deleteApplicationOutRecordMinByIds(List<Long> list); Integer deleteApplicationOutRecordMinByParentIds(List<Long> list);
/** /**
* 根据申请单号获取入库申请 * 根据申请单号获取入库申请

10
src/main/java/com/dreamchaser/depository_manage/depository_mapper/DepositoryRecordMapper.xml

@ -1980,12 +1980,18 @@
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<delete id="deleteApplicationOutRecordMinById"> <delete id="deleteApplicationOutRecordMinByParentId">
delete delete
from application_out_record_min from application_out_record_min
where parentId = #{id} where parentId = #{id}
</delete> </delete>
<delete id="deleteApplicationOutRecordMinByIds" parameterType="list">
<delete id="deleteApplicationOutRecordMinById">
delete
from application_out_record_min
where id = #{id}
</delete>
<delete id="deleteApplicationOutRecordMinByParentIds" parameterType="list">
DELETE FROM application_out_record_min WHERE parentId IN DELETE FROM application_out_record_min WHERE parentId IN
<foreach collection="list" index="index" item="id" open="(" separator="," close=")"> <foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id} #{id}

9
src/main/java/com/dreamchaser/depository_manage/service/DepositoryRecordService.java

@ -321,6 +321,15 @@ public interface DepositoryRecordService {
*/ */
Integer deleteApplicationOutRecordById(Long id, UserByPort userToken); Integer deleteApplicationOutRecordById(Long id, UserByPort userToken);
/**
* 用于退回出库子单
*
* @param id 退回的子单id
* @param userByPort 操作人
* @return
*/
Integer refundedApplicationOutRecordMinById(Long id, UserByPort userByPort, String userAgent, String userKey, String token);
/** /**
* 根据id集合删除多条出库记录 * 根据id集合删除多条出库记录
* *

210
src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java

@ -23,6 +23,7 @@ import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RLock; import org.redisson.api.RLock;
import org.redisson.api.RedissonClient; import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -327,7 +328,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
}); });
// 开启一个线程去删除子订单 // 开启一个线程去删除子订单
HandlesOtherFunctionalThreadPool.execute(() -> depositoryRecordMapper.deleteApplicationOutRecordMinById(id)); HandlesOtherFunctionalThreadPool.execute(() -> depositoryRecordMapper.deleteApplicationOutRecordMinByParentId(id));
return integer; return integer;
} }
@ -335,23 +336,97 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
/** /**
* 用于退回出库子单 * 用于退回出库子单
* @param id 退回的子单id *
* @param id 退回的子单id
* @param userByPort 操作人 * @param userByPort 操作人
* @return * @return
*/ */
public Integer refundedApplicationOutRecordMinById(Long id,UserByPort userByPort){ public Integer refundedApplicationOutRecordMinById(Long id, UserByPort userByPort, String userAgent, String userKey, String token) {
// 获取当前要退回的子单信息 // 获取当前要退回的子单信息
ApplicationOutRecordMin recordMin = depositoryRecordMapper.findApplicationOutMinById(id); ApplicationOutRecordMin recordMin = depositoryRecordMapper.findApplicationOutMinById(id);
// 获取主单信息 // 获取当前子单的主单
ApplicationOutRecord record = depositoryRecordMapper.findApplicationOutRecordPById(recordMin.getParentId()); Long parentId = recordMin.getParentId();
Integer trueOut = recordMin.getTrueOut(); ApplicationOutRecord record = depositoryRecordMapper.findApplicationOutRecordPById(parentId);
if(trueOut > 0){ int trueOut = recordMin.getTrueOut();
if (trueOut > 0) {
// 如果已经开始出库,则不允许退回 // 如果已经开始出库,则不允许退回
return -1; return -1;
} }
log.info(userByPort.getName()+"_"+userByPort.getNumber()+"删除了子单,数据为:"+JSONObject.toJSONString(recordMin));
return depositoryRecordMapper.deleteApplicationOutRecordMinById(id); String minRedisKey = "minRecord:" + id;
RedisTemplate<String, String> redisTemplateByDb = redisPool.getRedisTemplateByDb(15);
// 获取redis中存储的当前单的出库人
Object manager = redisTemplateByDb.opsForHash().get(minRedisKey, "manager");
if (manager != null) {
String manageString = manager.toString();
String[] managerStringSplit = manageString.split(",");
for (String s : managerStringSplit) {
String managerRedisKey = "user:" + s;
Object minRecord = redisTemplateByDb.opsForHash().get(managerRedisKey, "minRecord");
if (minRecord == null) {
continue;
}
String mindRecordString = minRecord.toString();
mindRecordString = mindRecordString.replace(minRedisKey + ",", "");
if (mindRecordString.length() == 2) {
// []
// 如果当前用户已经没有剩余订单,则删除
redisTemplateByDb.delete(managerRedisKey);
} else {
redisTemplateByDb.opsForHash().put(managerRedisKey, "minRecord", minRecord);
}
}
}
// 获取主单的所有子单
List<ApplicationOutRecordMin> recordMinList = depositoryRecordMapper.findApplicationOutRecordMinByParent(parentId);
// 获取删除结果
Integer result = depositoryRecordMapper.deleteApplicationOutRecordMinById(id);
String mainRedisKey = "record:" + parentId;
if (recordMinList.size() <= 1) {
// 如果主单的子单数小于等于1个,则删除主单
Integer integer = depositoryRecordMapper.deleteApplicationOutRecordById(parentId);
redisTemplateByDb.delete(mainRedisKey);
} else {
Object minRecord = redisTemplateByDb.opsForHash().get(mainRedisKey, "minRecord");
if (minRecord != null) {
String minRecordList = minRecord.toString();
// 获取所有子订单键值
minRecordList = minRecordList.replace(minRedisKey + ",", "");
if (minRecordList.length() == 2) {
// []
// 如果当前主单已经没有剩余订单,则删除
redisTemplateByDb.delete(mainRedisKey);
} else {
redisTemplateByDb.opsForHash().put(mainRedisKey, "minRecord", minRecordList);
}
String[] split = minRecordList.replace("[", "").replace("]", "").split(",");
int pass = 1; // 设置主订单最终状态
for (String value : split) {
// 获取所有子订单状态
String state = (String) redisPool.getRedisTemplateByDb(15).opsForHash().get(value, "state");
if ("1".equals(state)) {
// 如果有子订单未完成
pass = 3; // 设置主订单状态为处理中
break;
}
}
if (pass == 1) {
CompleteOutboundOperations(record, userAgent, userKey, token);
}
}
}
log.info(userByPort.getName() + "_" + userByPort.getNumber() + "删除了子单,数据为:" + JSONObject.toJSONString(recordMin));
HandlesOtherFunctionalThreadPool.execute(() -> qyWxOperationService.sendNotificationToApplicantForRefunded(userByPort, recordMin, record.getApplicantId(), userAgent));
return result;
} }
@ -393,7 +468,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
}); });
// 开启一个线程用于删除 // 开启一个线程用于删除
HandlesOtherFunctionalThreadPool.execute(() -> depositoryRecordMapper.deleteApplicationOutRecordMinByIds(list)); HandlesOtherFunctionalThreadPool.execute(() -> depositoryRecordMapper.deleteApplicationOutRecordMinByParentIds(list));
return integer; return integer;
} }
@ -2103,7 +2178,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
List<ApplicationOutRecordMin> applicationOutRecordMinByParent = depositoryRecordMapper.findApplicationOutRecordMinByParent(id); List<ApplicationOutRecordMin> applicationOutRecordMinByParent = depositoryRecordMapper.findApplicationOutRecordMinByParent(id);
if (applicationOutRecordMinByParent != null) { if (applicationOutRecordMinByParent != null) {
for (ApplicationOutRecordMin outRecordMin : applicationOutRecordMinByParent) { for (ApplicationOutRecordMin outRecordMin : applicationOutRecordMinByParent) {
depositoryRecordMapper.deleteApplicationOutRecordMinById(outRecordMin.getId()); depositoryRecordMapper.deleteApplicationOutRecordMinByParentId(outRecordMin.getId());
log.warn(DateUtil.getNowTime() + ": 删除出错的出库子订单:" + JSONObject.toJSONString(record)); log.warn(DateUtil.getNowTime() + ": 删除出错的出库子订单:" + JSONObject.toJSONString(record));
} }
} }
@ -2319,30 +2394,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
String redisOutKey = "wms_notificationOut_" + id; String redisOutKey = "wms_notificationOut_" + id;
redisPool.getRedisTemplateByDb(14).delete(redisOutKey); redisPool.getRedisTemplateByDb(14).delete(redisOutKey);
/*
// 设置子订单新编码
// 获取出库仓库信息
Depository depositoryRecordById = depositoryMapper.findDepositoryById(applicationOutMinById.getDepositoryId());
// 获取主订单单号
StringBuilder code = new StringBuilder(record.getCode());
// 获取申请用户信息
UserByPort applicantUser = userService.findUserByIdForNoPack(record.getApplicantId());
// 获取申请用户行政组织
Administration company = PublicConfig.getCompany(applicantUser.getMaindeparment(), userKey, token);
// 获取部门名称简写
String conpanyName = WordUtil.getPinYinHeadChar(company.getName());
// 获取仓库名称简写
String depositoryName = WordUtil.getPinYinHeadChar(depositoryRecordById.getDname());
// 获取部门名称在单号的起始位置
int index = code.indexOf(conpanyName);
// 生产新子订单编号
String newCode = code.replace(index, index + conpanyName.length(), depositoryName).toString();
// 设置新编码
applicationOutMinById.setCode(newCode);
*/
// 设置完成人 // 设置完成人
applicationOutMinById.setCheckId(userByPort.getId()); applicationOutMinById.setCheckId(userByPort.getId());
// 设置新库位 // 设置新库位
@ -2368,47 +2419,61 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
} }
} }
if (pass == 1) { // 如果最终状态为完成 if (pass == 1) { // 如果最终状态为完成
// 完成出库的相关操作
CompleteOutboundOperations(record, userAgent, userKey, token);
}
}
}
redisPool.getRedisTemplateByDb(15).delete(redisMainRecordKey);
Map<String, Object> map = new HashMap<>(); /**
map.put("pass", pass); * 用于完成出库时修改数据及发送通知
map.put("id", record.getId()); *
map.put("outTime", System.currentTimeMillis()); * @param record 完成的出库单
// 修改状态为完成 * @param userAgent userAgent
depositoryRecordMapper.updateApplicationOutRecord(map); * @param userKey userKey
* @param token userToken
// 将最终完成的订单抄送给仓储负责人 */
String depositoryManagerIds = record.getDepositoryManager(); public void CompleteOutboundOperations(ApplicationOutRecord record, String userAgent, String userKey, String token) {
String[] depositoryManagers = new String[0]; String redisMainRecordKey = "record:" + record.getId(); // 设置redis中主订单键值
if (depositoryManagerIds != null) { redisPool.getRedisTemplateByDb(15).delete(redisMainRecordKey);
depositoryManagers = depositoryManagerIds.split(",");
}
StringBuilder depositoryManagerByQyWx = new StringBuilder();
for (String s : depositoryManagers) {
if ("".equals(s)) {
continue;
}
Long uid = ObjectFormatUtil.toLong(s);
UserByPort depositoryManager = PublicConfig.FindUserById(uid, userKey, token);
// 获取用户的用工关系
int emptype = depositoryManager.getEmptype();
if (emptype > 10) {
continue;
}
String workwechat = depositoryManager.getWorkwechat();
if (workwechat == null || "".equals(workwechat)) {
workwechat = depositoryManager.getWechat();
}
// depositoryManagerByQyWx.append(workwechat+",");
}
depositoryManagerByQyWx.append("PangFuZhen,");
JSONObject jsonObject = qyWxOperationService.sendCcMessageToUsers(depositoryManagerByQyWx.toString(), record.getId(), userAgent, userKey, token);
// 删除redis中本订单 Map<String, Object> map = new HashMap<>();
redisPool.getRedisTemplateByDb(15).delete("record:" + record.getId()); map.put("pass", 1);
map.put("id", record.getId());
map.put("outTime", System.currentTimeMillis());
// 修改状态为完成
depositoryRecordMapper.updateApplicationOutRecord(map);
// 将最终完成的订单抄送给仓储负责人
String depositoryManagerIds = record.getDepositoryManager();
String[] depositoryManagers = new String[0];
if (depositoryManagerIds != null) {
depositoryManagers = depositoryManagerIds.split(",");
}
StringBuilder depositoryManagerByQyWx = new StringBuilder();
for (String s : depositoryManagers) {
if ("".equals(s)) {
continue;
}
Long uid = ObjectFormatUtil.toLong(s);
UserByPort depositoryManager = PublicConfig.FindUserById(uid, userKey, token);
// 获取用户的用工关系
int emptype = depositoryManager.getEmptype();
if (emptype > 10) {
continue;
}
String workwechat = depositoryManager.getWorkwechat();
if (workwechat == null || "".equals(workwechat)) {
workwechat = depositoryManager.getWechat();
} }
// depositoryManagerByQyWx.append(workwechat+",");
} }
depositoryManagerByQyWx.append("PangFuZhen,");
JSONObject jsonObject = qyWxOperationService.sendCcMessageToUsers(depositoryManagerByQyWx.toString(), record.getId(), userAgent, userKey, token);
// 删除redis中本订单
redisPool.getRedisTemplateByDb(15).delete("record:" + record.getId());
} }
/** /**
@ -5278,6 +5343,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
@Override @Override
public ApplicationOutRecordP findApplicationOutRecordPById(Long id) { public ApplicationOutRecordP findApplicationOutRecordPById(Long id) {
ApplicationOutRecord record = depositoryRecordMapper.findApplicationOutRecordPById(id); ApplicationOutRecord record = depositoryRecordMapper.findApplicationOutRecordPById(id);
if (record == null) {
return null;
}
return new ApplicationOutRecordP(record); return new ApplicationOutRecordP(record);
} }

49
src/main/resources/application-prod.yml

@ -17,35 +17,34 @@ spring:
##数据库设置 ##数据库设置
datasource: datasource:
dynamic: dynamic:
druid:
initialSize: 5 # 初始连接数
minIdle: 5 # 最小空闲数
maxActive: 20 #最大活跃连接数
maxWait: 60000 #获取连接的最大等待时间(毫秒)
timeBetweenEvictionRunsMillis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
minEvictableIdleTimeMillis: 300000 #配置一个连接在池中最小生存的时间,单位是毫秒
useGlobalDataSourceStat: true
testWhileIdle: true
testOnReturn: false
testOnBorrow: false
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
#配置监控统计拦截的filters,去掉后监控界面sql将无法统计,'wall'用于防火墙
filters: stat, wall, log4j
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
#超时回收机制
removeAbandoned: true
removeAbandonedTimeout: 1800
logAbandoned: true
datasource: datasource:
master: master:
username: depository username: depository # 用户名
password: NhE47edekBHxhjYk password: NhE47edekBHxhjYk #密码
url: jdbc:mysql://127.0.0.1:3306/depository?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8 url: jdbc:mysql://127.0.0.1:3306/depository?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver #driver
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
initialSize: 5
minIdle: 5
maxActive: 10
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1 FROM DUAL
useGlobalDataSourceStat: true
server:
port: 9090
testWhileIdle: true
testOnReturn: false
testOnBorrow: false
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
#配置监控统计拦截的filters,去掉后监控界面sql将无法统计,'wall'用于防火墙
filters: stat, wall, log4j
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
#超时回收机制
removeAbandoned: true
removeAbandonedTimeout: 1800
logAbandoned: true
hr_new: hr_new:
username: hr_new username: hr_new
password: AnknKiXiXaxNrw78 password: AnknKiXiXaxNrw78

46
src/main/resources/templates/pages/depository/table-out.html

@ -110,6 +110,8 @@
<script type="text/html" id="currentTableBar"> <script type="text/html" id="currentTableBar">
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete" <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete"
th:style="'display:'+${display}">删除</a> th:style="'display:'+${display}">删除</a>
<a class="layui-btn layui-btn-xs layui-btn-warm" lay-event="refunded"
th:style="'display:'+${display}">退回</a>
</script> </script>
<script type="text/html" id="approvalState"> <script type="text/html" id="approvalState">
@ -382,7 +384,8 @@
}, 'data'); }, 'data');
} }
}); });
} else if (obj.event === 'delete') { // 监听删除操作 }
else if (obj.event === 'delete') { // 监听删除操作
var checkStatus = table.checkStatus('currentTableId') var checkStatus = table.checkStatus('currentTableId')
, data = checkStatus.data; , data = checkStatus.data;
var req = {}; var req = {};
@ -460,7 +463,8 @@
layer.msg("未选中记录,请确认!"); layer.msg("未选中记录,请确认!");
return false; return false;
} }
} else if (obj.event === 'showEchart') { }
else if (obj.event === 'showEchart') {
let listItem = `<ul class="layui-table-tool-panel" style="max-height: 685px;"> let listItem = `<ul class="layui-table-tool-panel" style="max-height: 685px;">
<li lay-event="showLineEchart">查看折线图</li> <li lay-event="showLineEchart">查看折线图</li>
<li lay-event="showBarEchart">查看柱状图</li> <li lay-event="showBarEchart">查看柱状图</li>
@ -468,7 +472,8 @@
</ul>`; </ul>`;
$("#showEchart").append(listItem) $("#showEchart").append(listItem)
} else if (obj.event === "showSunburstEchart") { }
else if (obj.event === "showSunburstEchart") {
layer.open({ layer.open({
type: 2, type: 2,
offset: 'r', offset: 'r',
@ -480,7 +485,8 @@
id: 'applicationOutInfoForLeft', id: 'applicationOutInfoForLeft',
content: '/sunburstEchartForTable?type=2', content: '/sunburstEchartForTable?type=2',
}); });
} else if (obj.event === "showLineEchart") { }
else if (obj.event === "showLineEchart") {
layer.open({ layer.open({
type: 2, type: 2,
offset: 'r', offset: 'r',
@ -492,7 +498,8 @@
id: 'applicationOutInfoForLeft', id: 'applicationOutInfoForLeft',
content: '/lineOrBarEchartForTable?type=2&echartType=line', content: '/lineOrBarEchartForTable?type=2&echartType=line',
}); });
} else if (obj.event === "showBarEchart") { }
else if (obj.event === "showBarEchart") {
layer.open({ layer.open({
type: 2, type: 2,
offset: 'r', offset: 'r',
@ -586,6 +593,35 @@
}); });
} }
else if(obj.event === 'refunded'){
var req = {};
req.id = data.aormid;
layer.confirm('真的退回吗?', {icon: 2, title: '提示'}, function (index) {
$.ajax({
url: 'depositoryRecord/refundedApplicationOutRecordMin',
type: 'post',
dataType: 'json',
contentType: "application/json;charset=utf-8",
data: JSON.stringify(req),
beforeSend: function () {
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']});
},
success: function (data) {
layer.close(this.layerIndex);
if (data.status >= 300) {
layer.msg(data.statusInfo.message);//失败的表情
} else {
obj.del();
layer.msg("退回成功", {
icon: 6,//成功的表情
time: 1000 //1秒关闭(如果不配置,默认是3秒)
});
}
}
})
})
}
}); });
}); });

15
src/test/java/com/dreamchaser/depository_manage/SomeTest.java

@ -13,6 +13,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import java.util.Scanner;
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class SomeTest { public class SomeTest {
@ -26,10 +28,15 @@ public class SomeTest {
private UserService userService; private UserService userService;
@Test @Test
public void sendQyWxMsg(){ public void sendQyWxMsg() {
UserByPort userById = userService.findUserById(6235L); String a = "w,e,a,q,b";
ApplicationOutRecordMin applicationOutMinById = depositoryRecordMapper.findApplicationOutMinById(1002L); String[] split = a.split(",");
qyWxOperationService.sendNotificationToApplicantForRefunded(userById,applicationOutMinById,6235L,"555375c83c6f6cabc7f83f73d0270022"); for (String next : split) {
if ("q".equals(next)) {
return;
}
System.out.println(next);
}
} }
} }

Loading…
Cancel
Save