增加发起退货接口
This commit is contained in:
parent
7e2be0537f
commit
a10cab4f3f
|
|
@ -218,4 +218,25 @@ public class InvoicingThdApi {
|
||||||
return Result.error("操作失败");
|
return Result.error("操作失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退货-发起退货(临时接口,后续会删除)
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "退货-发起退货", notes = "退货-发起退货")
|
||||||
|
@AutoLog(value = "退货-发起退货", clientType = "app")
|
||||||
|
@PostMapping(value = "/requireTH")
|
||||||
|
public Result<?> requireTH(@RequestBody InvoicingThdMainEntity dto) {
|
||||||
|
if (StringUtils.isBlank(dto.getNuId()) || StringUtils.isBlank(dto.getElderId())) {
|
||||||
|
return Result.error("缺少参数");
|
||||||
|
}
|
||||||
|
boolean result = tuiHuoApi.requireTH(dto);
|
||||||
|
if (result) {
|
||||||
|
return Result.OK("操作成功");
|
||||||
|
} else {
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,4 +31,6 @@ public interface ITuiHuoApi {
|
||||||
boolean finishServe(InvoicingThdMainEntity dto);
|
boolean finishServe(InvoicingThdMainEntity dto);
|
||||||
|
|
||||||
boolean transRead(InvoicingThdMainEntity dto);
|
boolean transRead(InvoicingThdMainEntity dto);
|
||||||
|
|
||||||
|
boolean requireTH(InvoicingThdMainEntity dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -516,6 +516,7 @@ public class QingLingServiceImpl implements IQinglingApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean cancellation(InvoicingQldMainEntity dto) {
|
public boolean cancellation(InvoicingQldMainEntity dto) {
|
||||||
//检测是否可以正常作废
|
//检测是否可以正常作废
|
||||||
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "1,3")) {
|
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "1,3")) {
|
||||||
|
|
@ -724,6 +725,7 @@ public class QingLingServiceImpl implements IQinglingApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean orderReturn(InvoicingQldMainEntity dto) {
|
public boolean orderReturn(InvoicingQldMainEntity dto) {
|
||||||
//检测是否可以正常回退
|
//检测是否可以正常回退
|
||||||
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "1,4")) {
|
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "1,4")) {
|
||||||
|
|
@ -759,6 +761,7 @@ public class QingLingServiceImpl implements IQinglingApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Map<String, Object> outbound(InvoicingQldMainEntity dto) {
|
public Map<String, Object> outbound(InvoicingQldMainEntity dto) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,4 +18,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
public interface NuInvoicingThdMainMapper extends BaseMapper<NuInvoicingThdMain> {
|
public interface NuInvoicingThdMainMapper extends BaseMapper<NuInvoicingThdMain> {
|
||||||
|
|
||||||
IPage<InvoicingThdMainEntity> thdList(Page<NuInvoicingThdMain> page,@Param("dto") InvoicingThdMainEntity dto);
|
IPage<InvoicingThdMainEntity> thdList(Page<NuInvoicingThdMain> page,@Param("dto") InvoicingThdMainEntity dto);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,4 +54,5 @@
|
||||||
) DESC,
|
) DESC,
|
||||||
main.create_time DESC
|
main.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -96,8 +96,10 @@ public class ThdServiceImpl implements ITuiHuoApi {
|
||||||
.collect(Collectors.collectingAndThen(
|
.collect(Collectors.collectingAndThen(
|
||||||
Collectors.toList(),
|
Collectors.toList(),
|
||||||
list -> {
|
list -> {
|
||||||
int size = list.size();
|
List<InvoicingThdLogEntity> r_ = Lists.newArrayList();
|
||||||
return size <= 2 ? list : list.subList(size - 2, size);
|
r_.add(list.get(0));
|
||||||
|
r_.add(list.get(list.size() - 1));
|
||||||
|
return r_;
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
|
|
@ -122,6 +124,7 @@ public class ThdServiceImpl implements ITuiHuoApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean startServe(InvoicingThdMainEntity dto) {
|
public boolean startServe(InvoicingThdMainEntity dto) {
|
||||||
//查询当前状态
|
//查询当前状态
|
||||||
QueryWrapper<NuInvoicingThdMain> qw = new QueryWrapper<>();
|
QueryWrapper<NuInvoicingThdMain> qw = new QueryWrapper<>();
|
||||||
|
|
@ -449,6 +452,7 @@ public class ThdServiceImpl implements ITuiHuoApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean finishServe(InvoicingThdMainEntity dto) {
|
public boolean finishServe(InvoicingThdMainEntity dto) {
|
||||||
//查询当前状态
|
//查询当前状态
|
||||||
QueryWrapper<NuInvoicingThdMain> qw = new QueryWrapper<>();
|
QueryWrapper<NuInvoicingThdMain> qw = new QueryWrapper<>();
|
||||||
|
|
@ -489,4 +493,32 @@ public class ThdServiceImpl implements ITuiHuoApi {
|
||||||
return thdMainMapper.updateById(data) > 0 ? true : false;
|
return thdMainMapper.updateById(data) > 0 ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean requireTH(InvoicingThdMainEntity dto) {
|
||||||
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
String status = "0";//发起待执行
|
||||||
|
|
||||||
|
NuInvoicingThdMain main = new NuInvoicingThdMain();
|
||||||
|
main.setStatus(status);
|
||||||
|
main.setFqBy(sysUser.getId());//发起人
|
||||||
|
main.setFqTime(new Date());//发起时间
|
||||||
|
main.setNuId(dto.getNuId());//护理单元ID
|
||||||
|
main.setElderId(dto.getElderId());//长者id
|
||||||
|
main.setIzRead("N");//是否已读
|
||||||
|
thdMainMapper.insert(main);
|
||||||
|
|
||||||
|
//插入日志
|
||||||
|
NuInvoicingThdLog logData = new NuInvoicingThdLog();
|
||||||
|
logData.setThdId(main.getId());//退货指令id
|
||||||
|
logData.setStatus(status);//操作状态
|
||||||
|
logData.setOpeBy(sysUser.getId());//操作人
|
||||||
|
logData.setOpeTime(new Date());//操作时间
|
||||||
|
logData.setNuId(main.getNuId());//护理单元id
|
||||||
|
logData.setElderId(main.getElderId());//长者id
|
||||||
|
thdLogMapper.insert(logData);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue