Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b05e5742ae
|
|
@ -1,6 +1,7 @@
|
|||
package com.nu.modules.pad.invoicing.api;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.nu.entity.InvoicingThdGwcEntity;
|
||||
import com.nu.entity.InvoicingThdMainEntity;
|
||||
import com.nu.entity.NuKcslEntity;
|
||||
|
|
@ -13,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 退货单
|
||||
|
|
@ -74,4 +76,62 @@ public class InvoicingThdApi {
|
|||
}
|
||||
return Result.ok(tuiHuoApi.addThc(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 退货车查询
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询退货单-退货车查询", notes = "查询退货单-退货车查询")
|
||||
@GetMapping(value = "/thcList")
|
||||
public Result<List<InvoicingThdGwcEntity>> thcList(InvoicingThdGwcEntity dto) {
|
||||
if (StringUtils.isBlank(dto.getPkId())) {
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
List<InvoicingThdGwcEntity> pageList = tuiHuoApi.thcList(dto);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 退货单-移除退货车物料
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "退货单-移除退货车物料", notes = "退货单-移除退货车物料")
|
||||
@AutoLog(value = "退货单-移除退货车物料", clientType = "app")
|
||||
@PostMapping(value = "/removeWl")
|
||||
public Result<?> removeWl(@RequestBody InvoicingThdGwcEntity dto) {
|
||||
if (StringUtils.isBlank(dto.getPkId()) || StringUtils.isBlank(dto.getWlId())) {
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
boolean result = tuiHuoApi.removeWl(dto);
|
||||
if (result) {
|
||||
return Result.OK("移除成功");
|
||||
} else {
|
||||
return Result.error("移除失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 退货单-清空购物车
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "退货单-清空购物车", notes = "退货单-清空购物车")
|
||||
@AutoLog(value = "退货单-清空购物车", clientType = "app")
|
||||
@PostMapping(value = "/removeAll")
|
||||
public Result<?> removeAll(@RequestBody InvoicingThdGwcEntity dto) {
|
||||
if (StringUtils.isBlank(dto.getPkId())) {
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
boolean result = tuiHuoApi.removeAll(dto);
|
||||
if (result) {
|
||||
return Result.OK("操作成功");
|
||||
} else {
|
||||
return Result.error("操作失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,4 +43,8 @@ public class InvoicingThdGwcEntity implements Serializable {
|
|||
private String nuId;
|
||||
/**长者id nu_biz_elder_info.id*/
|
||||
private String elderId;
|
||||
/**
|
||||
* 物料信息
|
||||
*/
|
||||
private MaterialInfoEntity materialInfo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,4 +17,10 @@ public interface ITuiHuoApi {
|
|||
List<NuKcslEntity> thdNuMaterialList(InvoicingThdMainEntity dto);
|
||||
|
||||
Map<String,Object> addThc(InvoicingThdGwcEntity dto);
|
||||
|
||||
List<InvoicingThdGwcEntity> thcList(InvoicingThdGwcEntity dto);
|
||||
|
||||
boolean removeWl(InvoicingThdGwcEntity dto);
|
||||
|
||||
boolean removeAll(InvoicingThdGwcEntity dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -636,6 +636,7 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
nuInvoicingNuKcsl.setNuId(item.getNuId());
|
||||
nuInvoicingNuKcsl.setElderId(item.getElderId());
|
||||
nuInvoicingNuKcsl.setWlId(item.getWlId());
|
||||
nuInvoicingNuKcsl.setKfId((item.getKfId()));
|
||||
|
||||
if (nuKcslMap.containsKey(item.getWlId())) {
|
||||
// 如果已有对应物料
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.nu.modules.thd.mapper;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.nu.entity.InvoicingThdGwcEntity;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.thd.entity.NuInvoicingThdGwc;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
|
@ -14,4 +15,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
*/
|
||||
public interface NuInvoicingThdGwcMapper extends BaseMapper<NuInvoicingThdGwc> {
|
||||
|
||||
List<InvoicingThdGwcEntity> queryList(InvoicingThdGwcEntity dto);
|
||||
|
||||
int removeWl(InvoicingThdGwcEntity dto);
|
||||
|
||||
int removeAll(InvoicingThdGwcEntity dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,4 +2,67 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.thd.mapper.NuInvoicingThdGwcMapper">
|
||||
|
||||
</mapper>
|
||||
<select id="queryList" resultType="com.nu.entity.InvoicingThdGwcEntity">
|
||||
select
|
||||
thc.kf_id AS kfId,
|
||||
thc.wl_id AS wlId,
|
||||
thc.th_num AS thNum,
|
||||
thc.nu_id AS nuId,
|
||||
thc.elder_id AS elderId,
|
||||
material.id AS "materialInfo.id",
|
||||
material.category_id AS "materialInfo.categoryId",
|
||||
material.type_id AS "materialInfo.typeId",
|
||||
material.medication_id AS "materialInfo.medicationId",
|
||||
material.material_name AS "materialInfo.materialName",
|
||||
material.material_no AS "materialInfo.materialNo",
|
||||
material.specification_model AS "materialInfo.specificationModel",
|
||||
material.sales_unit_price AS "materialInfo.salesUnitPrice",
|
||||
material.reference_unit_price AS "materialInfo.referenceUnitPrice",
|
||||
material.material_units AS "materialInfo.materialUnits",
|
||||
material.multi_unit_switch AS "materialInfo.multiUnitSwitch",
|
||||
material.one_unit AS "materialInfo.oneUnit",
|
||||
material.one_unit_proportion AS "materialInfo.oneUnitProportion",
|
||||
material.one_unit_price AS "materialInfo.oneUnitPrice",
|
||||
material.two_unit AS "materialInfo.twoUnit",
|
||||
material.two_unit_proportion AS "materialInfo.twoUnitProportion",
|
||||
material.two_unit_price AS "materialInfo.twoUnitPrice",
|
||||
material.multi_unit_type AS "materialInfo.multiUnitType",
|
||||
material.suppliers AS "materialInfo.suppliers",
|
||||
material.material_img AS "materialInfo.materialImg",
|
||||
material.material_ident AS "materialInfo.materialIdent",
|
||||
material.iz_enabled AS "materialInfo.izEnabled",
|
||||
material.del_flag AS "materialInfo.delFlag",
|
||||
material.create_by AS "materialInfo.createBy",
|
||||
material.create_time AS "materialInfo.createTime",
|
||||
material.update_by AS "materialInfo.updateBy",
|
||||
material.update_time AS "materialInfo.updateTime",
|
||||
material.sys_org_code AS "materialInfo.sysOrgCode",
|
||||
material.pinyin AS "materialInfo.pinyin",
|
||||
material.upper_limit AS "materialInfo.upperLimit",
|
||||
material.lower_limit AS "materialInfo.lowerLimit",
|
||||
material.tag_type AS "materialInfo.tagType",
|
||||
material.iz_ybbx AS "materialInfo.izYbbx",
|
||||
material.iz_jgyh AS "materialInfo.izJgyh"
|
||||
from nu_invoicing_thd_gwc thc
|
||||
LEFT JOIN nu_config_material_info material ON thc.wl_id = material.id
|
||||
<where>
|
||||
<if test="pkId != null and pkId != ''">
|
||||
and thc.pk_id = #{pkId}
|
||||
</if>
|
||||
</where>
|
||||
order by thc.create_time desc
|
||||
</select>
|
||||
|
||||
<delete id="removeWl">
|
||||
delete
|
||||
from nu_invoicing_thd_gwc
|
||||
where pk_id = #{pkId}
|
||||
and wl_id = #{wlId}
|
||||
</delete>
|
||||
|
||||
<delete id="removeAll">
|
||||
delete
|
||||
from nu_invoicing_thd_gwc
|
||||
where pk_id = #{pkId}
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nu.modules.thd.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
|
@ -59,18 +60,18 @@ public class ThdServiceImpl implements ITuiHuoApi {
|
|||
NuInvoicingNuKcsl kcsl = nuKcslMapper.selectOne(kcslQW);
|
||||
if (kcsl == null || kcsl.getWlNum() == null || kcsl.getWlNum() < dto.getThNum()) {
|
||||
//护理单元无此物料/存量小于退货数量
|
||||
result.put("status","numError");
|
||||
result.put("status", "numError");
|
||||
return result;
|
||||
}
|
||||
|
||||
//退货车是否已存在此物料
|
||||
QueryWrapper<NuInvoicingThdGwc> thcQW = new QueryWrapper<>();
|
||||
thcQW.eq("pk_id",dto.getPkId());
|
||||
thcQW.eq("wl_id",dto.getWlId());
|
||||
thcQW.eq("pk_id", dto.getPkId());
|
||||
thcQW.eq("wl_id", dto.getWlId());
|
||||
List<NuInvoicingThdGwc> thcList = thdGwcMapper.selectList(thcQW);
|
||||
if(!CollectionUtils.isEmpty(thcList)){
|
||||
if (!CollectionUtils.isEmpty(thcList)) {
|
||||
//已存在该物料
|
||||
result.put("status","existed");
|
||||
result.put("status", "existed");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -84,7 +85,22 @@ public class ThdServiceImpl implements ITuiHuoApi {
|
|||
thc.setThNum(dto.getThNum());//退货数量
|
||||
thdGwcMapper.insert(thc);//新增
|
||||
|
||||
result.put("status","success");
|
||||
result.put("status", "success");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InvoicingThdGwcEntity> thcList(InvoicingThdGwcEntity dto) {
|
||||
return thdGwcMapper.queryList(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeWl(InvoicingThdGwcEntity dto) {
|
||||
return thdGwcMapper.removeWl(dto) > 0 ? true : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeAll(InvoicingThdGwcEntity dto) {
|
||||
return thdGwcMapper.removeAll(dto) > 0 ? true : false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue