新增单据类型删除时校验单据,用户,仓库是否存在,

新增页面单据类型关联仓库查询,新增单据核对人,更改核对时间
master
anthonywj 2 years ago
parent 8fc19cfeb0
commit f8437f1c1a

@ -1,6 +1,7 @@
package com.glxp.api.controller.basic; package com.glxp.api.controller.basic;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@ -13,7 +14,9 @@ import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType; import com.glxp.api.constant.BusinessType;
import com.glxp.api.constant.ConstantType; import com.glxp.api.constant.ConstantType;
import com.glxp.api.controller.BaseController; import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.auth.WarehouseBussinessTypeEntity;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity; import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.req.auth.FilterInvBusTypeRequest;
import com.glxp.api.req.basic.BusNoUserRequest; import com.glxp.api.req.basic.BusNoUserRequest;
import com.glxp.api.req.basic.BussinessTypeSaveRequest; import com.glxp.api.req.basic.BussinessTypeSaveRequest;
import com.glxp.api.req.basic.FilterBussinessTypeRequest; import com.glxp.api.req.basic.FilterBussinessTypeRequest;
@ -23,7 +26,10 @@ import com.glxp.api.res.basic.BasicBussinessTypeResponse;
import com.glxp.api.res.basic.BussinessTypExportResponse; import com.glxp.api.res.basic.BussinessTypExportResponse;
import com.glxp.api.res.basic.CandidateRequest; import com.glxp.api.res.basic.CandidateRequest;
import com.glxp.api.service.auth.CustomerService; import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.auth.InvBusUserService;
import com.glxp.api.service.auth.WarehouseBussinessTypeService;
import com.glxp.api.service.basic.IBasicBussinessTypeService; import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.service.inout.IoOrderService;
import com.glxp.api.util.CustomUtil; import com.glxp.api.util.CustomUtil;
import com.glxp.api.util.FileUtils; import com.glxp.api.util.FileUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -54,6 +60,8 @@ public class BasicBussinessTypeController extends BaseController {
private IBasicBussinessTypeService basicBussinessTypeService; private IBasicBussinessTypeService basicBussinessTypeService;
@Resource @Resource
private CustomerService customerService; private CustomerService customerService;
@Resource
WarehouseBussinessTypeService warehouseBussinessTypeService;
/** /**
* *
@ -185,12 +193,33 @@ public class BasicBussinessTypeController extends BaseController {
if (StrUtil.isNotEmpty(bussinessTypeFilterRequest.getVueType())) { if (StrUtil.isNotEmpty(bussinessTypeFilterRequest.getVueType())) {
List<BasicBussinessTypeEntity> result = new ArrayList<>();
List<BasicBussinessTypeEntity> bussinessTypeEntities = basicBussinessTypeService.findByVueType(bussinessTypeFilterRequest.getVueType()); List<BasicBussinessTypeEntity> bussinessTypeEntities = basicBussinessTypeService.findByVueType(bussinessTypeFilterRequest.getVueType());
if (StrUtil.isNotEmpty(bussinessTypeFilterRequest.getInvCode()) || StrUtil.isNotEmpty(bussinessTypeFilterRequest.getCode())) {
//过滤是否是当前仓库底下单据类型
FilterBussinessTypeRequest tempRequest = new FilterBussinessTypeRequest();
tempRequest.setCode(bussinessTypeFilterRequest.getCode());
tempRequest.setInvCode(bussinessTypeFilterRequest.getInvCode());
List<BasicBussinessTypeResponse> bussinessTypeResponses = basicBussinessTypeService.filterJoinByInv(tempRequest);
if (CollUtil.isNotEmpty(bussinessTypeResponses)) {
for (BasicBussinessTypeResponse bussinessTypExportResponse : bussinessTypeResponses) {
for (BasicBussinessTypeEntity basicBussinessTypeEntity : bussinessTypeEntities) {
if (bussinessTypExportResponse.getAction().equals(basicBussinessTypeEntity.getAction())) {
result.add(basicBussinessTypeEntity);
}
}
}
}
} else {
result.addAll(bussinessTypeEntities);
}
PageInfo<BasicBussinessTypeEntity> pageInfo; PageInfo<BasicBussinessTypeEntity> pageInfo;
pageInfo = new PageInfo<>(bussinessTypeEntities); pageInfo = new PageInfo<>(result);
PageSimpleResponse<BasicBussinessTypeEntity> pageSimpleResponse = new PageSimpleResponse<>(); PageSimpleResponse<BasicBussinessTypeEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal()); pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(bussinessTypeEntities); pageSimpleResponse.setList(result);
return ResultVOUtils.success(pageSimpleResponse); return ResultVOUtils.success(pageSimpleResponse);
} else { } else {
@ -202,10 +231,10 @@ public class BasicBussinessTypeController extends BaseController {
bussinessTypeFilterRequest); bussinessTypeFilterRequest);
} else { } else {
//当前用户为供应商,查询单据类型添加允许供应商使用参数 //当前用户为供应商,查询单据类型添加允许供应商使用参数
if (bussinessTypeFilterRequest.getSpUse() == null) if (bussinessTypeFilterRequest.getSpUse() == null) {
bussinessTypeFilterRequest.setSpUse(3); bussinessTypeFilterRequest.setSpUse(3);
bussinessTypeEntities = basicBussinessTypeService.filterJoinByInv( }
bussinessTypeFilterRequest); bussinessTypeEntities = basicBussinessTypeService.filterJoinByInv(bussinessTypeFilterRequest);
} }
@ -220,6 +249,10 @@ public class BasicBussinessTypeController extends BaseController {
} }
@Resource
IoOrderService orderService;
@Resource
InvBusUserService invBusUserService;
/** /**
* *
@ -238,21 +271,24 @@ public class BasicBussinessTypeController extends BaseController {
String id = deleteRequest.getId(); String id = deleteRequest.getId();
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.selectById(id); BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.selectById(id);
//TODO 单据使用绑定和仓库绑定校验未做,等其他模块功能做完之后进行完善 //判断是否存在该单据类型单据
/*OrderFilterRequest orderFilterRequest = new OrderFilterRequest(); boolean isExitOrder = orderService.isExitByAction(bussinessTypeEntity.getAction());
orderFilterRequest.setAction(bussinessTypeEntity.getAction()); if (isExitOrder) {
OrderEntity orderEntity = orderService.findOne(orderFilterRequest);
if (orderEntity != null) {
return ResultVOUtils.error(500, "已存在该类型扫码单据,无法删除!"); return ResultVOUtils.error(500, "已存在该类型扫码单据,无法删除!");
} }
//判断是否被仓库绑定
boolean isExitUser = invBusUserService.isExitByAction(bussinessTypeEntity.getAction());
if (isExitUser) {
return ResultVOUtils.error(500, "该单据类型已被用户绑定,请先移除后删除!");
}
//判断是否被用户绑定
boolean isExitInv = warehouseBussinessTypeService.isExitByAction(bussinessTypeEntity.getAction());
if (isExitInv) {
return ResultVOUtils.error(500, "该单据类型已被仓库绑定,请先移除后删除!");
}
FilterInvBusTypeRequest filterInvBusTypeRequest = new FilterInvBusTypeRequest();
filterInvBusTypeRequest.setAction(bussinessTypeEntity.getAction());
List<WarehouseBussinessTypeEntity> warehouseBussinessTypeEntities = warehouseBussinessTypeService.filterList(filterInvBusTypeRequest);
if (CollUtil.isNotEmpty(warehouseBussinessTypeEntities)) {
return ResultVOUtils.error(500, "单据类型已被仓库分库绑定,无法删除");
}*/
return basicBussinessTypeService.deleteBussinessType(id) == true ? ResultVOUtils.success("删除成功") : ResultVOUtils.error(500, "删除失败,系统繁忙"); return basicBussinessTypeService.deleteBussinessType(id) == true ? ResultVOUtils.success("删除成功") : ResultVOUtils.error(500, "删除失败,系统繁忙");
} }

@ -402,7 +402,7 @@ public class IoOrderReviewController extends BaseController {
//前端第二次次验收 //前端第二次次验收
public BaseResponse thirdUpdateReview(AuthAdmin authAdmin, IoOrderEntity orderEntity) { public BaseResponse thirdUpdateReview(AuthAdmin authAdmin, IoOrderEntity orderEntity) {
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK_REW); orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK_REW);
orderEntity.setReviewUser(authAdmin.getId() + ""); orderEntity.setCheckUser(authAdmin.getId() + "");
orderEntity.setUpdateTime(new Date()); orderEntity.setUpdateTime(new Date());
orderEntity.setCheckTime(new Date()); orderEntity.setCheckTime(new Date());
orderEntity.setDeliveryStatus(ConstantStatus.ORDER_DELIVERY_STATUS_ED); orderEntity.setDeliveryStatus(ConstantStatus.ORDER_DELIVERY_STATUS_ED);

@ -346,7 +346,6 @@ public class ThrProductsAddDiController {
} }
/** /**
* DI * DI
* *
@ -358,12 +357,12 @@ public class ThrProductsAddDiController {
@Log(title = "DI产品信息", businessType = BusinessType.UPDATE) @Log(title = "DI产品信息", businessType = BusinessType.UPDATE)
public BaseResponse updateThrAddDiProductsList() { public BaseResponse updateThrAddDiProductsList() {
FilterThrProductsRequest filterThrProductsRequest=new FilterThrProductsRequest(); FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
filterThrProductsRequest.setStatus(2); filterThrProductsRequest.setStatus(2);
filterThrProductsRequest.setDiType(1); filterThrProductsRequest.setDiType(1);
List<ThrProductsAddDiEntity> thrProductsAddDiEntityList=thrProductsAddDiService.filterThrProductsDiLists(filterThrProductsRequest); List<ThrProductsAddDiEntity> thrProductsAddDiEntityList = thrProductsAddDiService.filterThrProductsDiLists(filterThrProductsRequest);
for (ThrProductsAddDiEntity thrProductsAddDiEntity:thrProductsAddDiEntityList){ for (ThrProductsAddDiEntity thrProductsAddDiEntity : thrProductsAddDiEntityList) {
thrProductsAddDiEntity.setAuditTime(new Date()); thrProductsAddDiEntity.setAuditTime(new Date());
thrProductsAddDiEntity.setAuditUser(customerService.getUserId() + ""); thrProductsAddDiEntity.setAuditUser(customerService.getUserId() + "");
thrProductsAddDiService.updateDiProduct(thrProductsAddDiEntity); thrProductsAddDiService.updateDiProduct(thrProductsAddDiEntity);

@ -1,5 +1,7 @@
package com.glxp.api.dao.auth; package com.glxp.api.dao.auth;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.auth.InvBusUserEntity;
import com.glxp.api.entity.auth.WarehouseBussinessTypeEntity; import com.glxp.api.entity.auth.WarehouseBussinessTypeEntity;
import com.glxp.api.req.auth.FilterInvBusTypeRequest; import com.glxp.api.req.auth.FilterInvBusTypeRequest;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -8,14 +10,14 @@ import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@Mapper @Mapper
public interface WarehouseBussinessTypeDao { public interface WarehouseBussinessTypeDao extends BaseMapperPlus<WarehouseBussinessTypeDao, WarehouseBussinessTypeEntity, WarehouseBussinessTypeEntity> {
WarehouseBussinessTypeEntity selectById(Integer id); WarehouseBussinessTypeEntity selectById(Integer id);
int deleteByPrimaryKey(Integer id); int deleteByPrimaryKey(Integer id);
int insert(WarehouseBussinessTypeEntity record); int insert(WarehouseBussinessTypeEntity record);
int insertOrUpdate(WarehouseBussinessTypeEntity record); // int insertOrUpdate(WarehouseBussinessTypeEntity record);
int insertOrUpdateSelective(WarehouseBussinessTypeEntity record); int insertOrUpdateSelective(WarehouseBussinessTypeEntity record);
@ -47,4 +49,4 @@ public interface WarehouseBussinessTypeDao {
* @return * @return
*/ */
List<WarehouseBussinessTypeEntity> selectByActions(@Param("subInvCode") String subInvCode, @Param("actions") List<String> actions); List<WarehouseBussinessTypeEntity> selectByActions(@Param("subInvCode") String subInvCode, @Param("actions") List<String> actions);
} }

@ -1,13 +1,24 @@
package com.glxp.api.entity.auth; package com.glxp.api.entity.auth;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
@Data @Data
@TableName(value = "auth_user_bustype")
public class InvBusUserEntity { public class InvBusUserEntity {
@TableId(value = "id", type = IdType.AUTO)
private Integer id; private Integer id;
@TableField(value = "userId")
private String userId; private String userId;
@TableField(value = "subInvCode")
private String subInvCode; private String subInvCode;
@TableField(value = "scAction")
private String scAction; private String scAction;
@TableField(value = "remark")
private String remark; private String remark;
} }

@ -1,31 +1,41 @@
package com.glxp.api.entity.auth; package com.glxp.api.entity.auth;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
/** /**
* - * -
*/ */
@Data @Data
@TableName(value = "auth_warehouse_bustype")
public class WarehouseBussinessTypeEntity { public class WarehouseBussinessTypeEntity {
/** /**
* id * id
*/ */
@TableId(value = "id", type = IdType.AUTO)
private Integer id; private Integer id;
/** /**
* *
*/ */
@TableField(value = "code")
private String code; private String code;
/** /**
* *
*/ */
@TableField(value = "action")
private String action; private String action;
/** /**
* *
*/ */
@TableField(value = "name")
private String name; private String name;
@TableField(exist = false)
private boolean select; private boolean select;
} }

@ -34,4 +34,4 @@ public class WarehouseUserEntity {
private String employeeName; private String employeeName;
} }

@ -111,6 +111,10 @@ public class IoOrderEntity {
@TableField(value = "auditTime") @TableField(value = "auditTime")
private Date auditTime; private Date auditTime;
@TableField(value = "checkUser")
private String checkUser;
@TableField(value = "checkTime") @TableField(value = "checkTime")
private Date checkTime; private Date checkTime;

@ -21,7 +21,7 @@ public class TableUtils {
"/productCert/sup_cert/id/productId/productIdFk/updateTime/filePath/type=3/产品资质证书信息", "/productCert/sup_cert/id/productId/productIdFk/updateTime/filePath/type=3/产品资质证书信息",
"//udicompany/id///updateTime///国际库医疗器械注册人信息", "//udicompany/id///updateTime///国际库医疗器械注册人信息",
"basicType//basic_hosp_type/id///updateTime///物资字典分类", "basicType//basic_hosp_type/id///updateTime///物资字典分类",
"//io_order_invoice/id///updateTime/filePath//发票信息", "//io_order_invoice/id///updateTime/licenseUrl//发票信息",
}; };

@ -176,6 +176,8 @@ public class IoOrderResponse {
*/ */
private String reviewUserName; private String reviewUserName;
private String checkUserName;
/** /**
* *
*/ */

@ -73,6 +73,7 @@ public class InvPreinOrderResponse {
private String createUserName; private String createUserName;
private String updateUserName; private String updateUserName;
private String reviewUserName; private String reviewUserName;
private String checkUserName;
private String fromCorpName; private String fromCorpName;
private String deptName; private String deptName;

@ -5,6 +5,7 @@ import com.glxp.api.entity.auth.InvBusUserEntity;
import com.glxp.api.entity.auth.WarehouseBussinessTypeEntity; import com.glxp.api.entity.auth.WarehouseBussinessTypeEntity;
import com.glxp.api.req.auth.FilterInvBusUserRequest; import com.glxp.api.req.auth.FilterInvBusUserRequest;
import com.glxp.api.res.auth.InvBusUserResponse; import com.glxp.api.res.auth.InvBusUserResponse;
import java.util.List; import java.util.List;
public interface InvBusUserService { public interface InvBusUserService {
@ -24,6 +25,10 @@ public interface InvBusUserService {
boolean deleteById(String id); boolean deleteById(String id);
boolean deleteByUnion(String userId, String subInvCode); boolean deleteByUnion(String userId, String subInvCode);
boolean deleteByscAction( String subInvCode, List<String> selectedCodes);
boolean deleteByscAction(String subInvCode, List<String> selectedCodes);
boolean isExitByAction(String action);
} }

@ -51,4 +51,7 @@ public interface WarehouseBussinessTypeService {
*/ */
List<WarehouseBussinessTypeEntity> selectByActions(String subInvCode, List<String> actions); List<WarehouseBussinessTypeEntity> selectByActions(String subInvCode, List<String> actions);
boolean isExitByAction(String action);
} }

@ -1,6 +1,7 @@
package com.glxp.api.service.auth.impl; package com.glxp.api.service.auth.impl;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.auth.InvBusUserDao; import com.glxp.api.dao.auth.InvBusUserDao;
import com.glxp.api.entity.auth.InvBusUserEntity; import com.glxp.api.entity.auth.InvBusUserEntity;
@ -98,10 +99,15 @@ public class InvBusUserServiceImpl implements InvBusUserService {
} }
@Override @Override
public boolean deleteByscAction(String subInvCode,List<String> selectedCodes) { public boolean deleteByscAction(String subInvCode, List<String> selectedCodes) {
if (CollectionUtils.isEmpty(selectedCodes) || StrUtil.isEmpty(subInvCode)) { if (CollectionUtils.isEmpty(selectedCodes) || StrUtil.isEmpty(subInvCode)) {
return false; return false;
} }
return invBusUserDao.deleteByscAction(subInvCode,selectedCodes); return invBusUserDao.deleteByscAction(subInvCode, selectedCodes);
}
@Override
public boolean isExitByAction(String action) {
return invBusUserDao.exists(new QueryWrapper<InvBusUserEntity>().eq("scAction", action));
} }
} }

@ -1,6 +1,7 @@
package com.glxp.api.service.auth.impl; package com.glxp.api.service.auth.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.auth.WarehouseBussinessTypeDao; import com.glxp.api.dao.auth.WarehouseBussinessTypeDao;
import com.glxp.api.entity.auth.WarehouseBussinessTypeEntity; import com.glxp.api.entity.auth.WarehouseBussinessTypeEntity;
@ -99,4 +100,9 @@ public class WarehouseBussinessTypeServiceImpl implements WarehouseBussinessType
public List<WarehouseBussinessTypeEntity> selectByActions(String subInvCode, List<String> actions) { public List<WarehouseBussinessTypeEntity> selectByActions(String subInvCode, List<String> actions) {
return warehouseBussinessTypeDao.selectByActions(subInvCode, actions); return warehouseBussinessTypeDao.selectByActions(subInvCode, actions);
} }
@Override
public boolean isExitByAction(String action) {
return warehouseBussinessTypeDao.exists(new QueryWrapper<WarehouseBussinessTypeEntity>().eq("action", action));
}
} }

@ -151,17 +151,21 @@ public class IoAddInoutService {
insertList.clear(); insertList.clear();
return; return;
} }
//三期校验
String checkOriginMsg = checkOriginCode(warehouseEntity); if (bussinessTypeEntity.isCodeFillCheck()) {
if (StrUtil.isNotEmpty(checkOriginMsg)) { //三期校验
orderEntity.setErrMsg(checkOriginMsg); String checkOriginMsg = checkOriginCode(warehouseEntity);
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); if (StrUtil.isNotEmpty(checkOriginMsg)) {
orderEntity.setUpdateTime(new Date()); orderEntity.setErrMsg(checkOriginMsg);
orderService.update(orderEntity); orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
insertList.clear(); orderEntity.setUpdateTime(new Date());
return; orderService.update(orderEntity);
insertList.clear();
return;
}
} }
//产品是否已维护已关联 //产品是否已维护已关联
if ((warehouseEntity.getRelId() == null)) { if ((warehouseEntity.getRelId() == null)) {
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR); orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);

@ -119,4 +119,7 @@ public interface IoOrderService {
* @return * @return
*/ */
BaseResponse submitToThrSys(String billNo); BaseResponse submitToThrSys(String billNo);
boolean isExitByAction(String action);
} }

@ -727,6 +727,11 @@ public class IoOrderServiceImpl implements IoOrderService {
} }
} }
@Override
public boolean isExitByAction(String action) {
return orderDao.exists(new QueryWrapper<IoOrderEntity>().eq("action", action));
}
/** /**
* *
* *

@ -22,17 +22,16 @@
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated--> <!--@mbg.generated-->
delete from auth_warehouse_bustype delete
from auth_warehouse_bustype
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</delete> </delete>
<insert id="insert" keyColumn="id" keyProperty="id" <insert id="insert" keyColumn="id" keyProperty="id"
parameterType="com.glxp.api.entity.auth.WarehouseBussinessTypeEntity" useGeneratedKeys="true"> parameterType="com.glxp.api.entity.auth.WarehouseBussinessTypeEntity" useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
insert into auth_warehouse_bustype (code, `action`, `name` insert into auth_warehouse_bustype (code, `action`, `name`)
) values (#{code,jdbcType=VARCHAR}, #{action,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR})
values (#{code,jdbcType=VARCHAR}, #{action,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}
)
</insert> </insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" <insert id="insertSelective" keyColumn="id" keyProperty="id"
parameterType="com.glxp.api.entity.auth.WarehouseBussinessTypeEntity" useGeneratedKeys="true"> parameterType="com.glxp.api.entity.auth.WarehouseBussinessTypeEntity" useGeneratedKeys="true">
@ -81,9 +80,9 @@
<update id="updateByPrimaryKey" parameterType="com.glxp.api.entity.auth.WarehouseBussinessTypeEntity"> <update id="updateByPrimaryKey" parameterType="com.glxp.api.entity.auth.WarehouseBussinessTypeEntity">
<!--@mbg.generated--> <!--@mbg.generated-->
update auth_warehouse_bustype update auth_warehouse_bustype
set code = #{code,jdbcType=VARCHAR}, set code = #{code,jdbcType=VARCHAR},
`action` = #{action,jdbcType=VARCHAR}, `action` = #{action,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR} `name` = #{name,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<update id="updateBatch" parameterType="java.util.List"> <update id="updateBatch" parameterType="java.util.List">
@ -145,44 +144,43 @@
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true"> <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
insert into auth_warehouse_bustype insert into auth_warehouse_bustype
(code, `action`, `name`) (code, `action`, `name`)
values values
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.code,jdbcType=VARCHAR}, #{item.action,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR} (#{item.code,jdbcType=VARCHAR}, #{item.action,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR})
)
</foreach> </foreach>
</insert> </insert>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" <!-- <insert id="insertOrUpdate" keyColumn="id" keyProperty="id"-->
parameterType="com.glxp.api.entity.auth.WarehouseBussinessTypeEntity" useGeneratedKeys="true"> <!-- parameterType="com.glxp.api.entity.auth.WarehouseBussinessTypeEntity" useGeneratedKeys="true">-->
<!--@mbg.generated--> <!-- &lt;!&ndash;@mbg.generated&ndash;&gt;-->
insert into auth_warehouse_bustype <!-- insert into auth_warehouse_bustype-->
<trim prefix="(" suffix=")" suffixOverrides=","> <!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->
<if test="id != null"> <!-- <if test="id != null">-->
id, <!-- id,-->
</if> <!-- </if>-->
code, <!-- code,-->
`action`, <!-- `action`,-->
`name`, <!-- `name`,-->
</trim> <!-- </trim>-->
values <!-- values-->
<trim prefix="(" suffix=")" suffixOverrides=","> <!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->
<if test="id != null"> <!-- <if test="id != null">-->
#{id,jdbcType=INTEGER}, <!-- #{id,jdbcType=INTEGER},-->
</if> <!-- </if>-->
#{code,jdbcType=VARCHAR}, <!-- #{code,jdbcType=VARCHAR},-->
#{action,jdbcType=VARCHAR}, <!-- #{action,jdbcType=VARCHAR},-->
#{name,jdbcType=VARCHAR}, <!-- #{name,jdbcType=VARCHAR},-->
</trim> <!-- </trim>-->
on duplicate key update <!-- on duplicate key update-->
<trim suffixOverrides=","> <!-- <trim suffixOverrides=",">-->
<if test="id != null"> <!-- <if test="id != null">-->
id = #{id,jdbcType=INTEGER}, <!-- id = #{id,jdbcType=INTEGER},-->
</if> <!-- </if>-->
code = #{code,jdbcType=VARCHAR}, <!-- code = #{code,jdbcType=VARCHAR},-->
`action` = #{action,jdbcType=VARCHAR}, <!-- `action` = #{action,jdbcType=VARCHAR},-->
`name` = #{name,jdbcType=VARCHAR}, <!-- `name` = #{name,jdbcType=VARCHAR},-->
</trim> <!-- </trim>-->
</insert> <!-- </insert>-->
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" <insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id"
parameterType="com.glxp.api.entity.auth.WarehouseBussinessTypeEntity" useGeneratedKeys="true"> parameterType="com.glxp.api.entity.auth.WarehouseBussinessTypeEntity" useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
@ -239,14 +237,15 @@
auth_warehouse_bustype.action, auth_warehouse_bustype.action,
basic_bussiness_type.name basic_bussiness_type.name
from auth_warehouse_bustype from auth_warehouse_bustype
inner join basic_bussiness_type on auth_warehouse_bustype.action = basic_bussiness_type.action inner join basic_bussiness_type on auth_warehouse_bustype.action = basic_bussiness_type.action
where code = #{code} where code = #{code}
</select> </select>
<select id="filterList" parameterType="com.glxp.api.req.auth.FilterInvBusTypeRequest" <select id="filterList" parameterType="com.glxp.api.req.auth.FilterInvBusTypeRequest"
resultType="com.glxp.api.entity.auth.WarehouseBussinessTypeEntity"> resultType="com.glxp.api.entity.auth.WarehouseBussinessTypeEntity">
SELECT * FROM auth_warehouse_bustype SELECT *
FROM auth_warehouse_bustype
<where> <where>
<if test="id != '' and id != null"> <if test="id != '' and id != null">
AND id = #{id} AND id = #{id}
@ -258,7 +257,6 @@
AND `action` = #{action} AND `action` = #{action}
</if> </if>
</where> </where>
</select> </select>
<select id="selectById" resultMap="BaseResultMap"> <select id="selectById" resultMap="BaseResultMap">
select * select *
@ -272,7 +270,7 @@
auth_warehouse_bustype.action, auth_warehouse_bustype.action,
basic_bussiness_type.name basic_bussiness_type.name
from auth_warehouse_bustype from auth_warehouse_bustype
inner join basic_bussiness_type on auth_warehouse_bustype.action = basic_bussiness_type.action inner join basic_bussiness_type on auth_warehouse_bustype.action = basic_bussiness_type.action
where code = #{code} where code = #{code}
</select> </select>
@ -284,9 +282,11 @@
</delete> </delete>
<select id="selectByActions" resultType="com.glxp.api.entity.auth.WarehouseBussinessTypeEntity"> <select id="selectByActions" resultType="com.glxp.api.entity.auth.WarehouseBussinessTypeEntity">
select * from auth_warehouse_bustype where code = #{subInvCode} and action in select *
from auth_warehouse_bustype where code = #{subInvCode}
and action in
<foreach collection="actions" item="item" index="index" open="(" close=")" separator=","> <foreach collection="actions" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
</select> </select>
</mapper> </mapper>

@ -9,6 +9,7 @@
(select employeeName from auth_user au where au.id = io.createUser) createUserName, (select employeeName from auth_user au where au.id = io.createUser) createUserName,
(select employeeName from auth_user au2 where au2.id = io.updateUser) updateUserName, (select employeeName from auth_user au2 where au2.id = io.updateUser) updateUserName,
(select employeeName from auth_user au3 where au3.id = io.reviewUser) reviewUserName, (select employeeName from auth_user au3 where au3.id = io.reviewUser) reviewUserName,
(select employeeName from auth_user au4 where au4.id = io.checkUser) checkUserName,
(select name from auth_dept ad2 where ad2.code = io.fromDeptCode) fromDeptName, (select name from auth_dept ad2 where ad2.code = io.fromDeptCode) fromDeptName,
(select name from auth_warehouse aw2 where aw2.code = io.fromInvCode) fromInvName, (select name from auth_warehouse aw2 where aw2.code = io.fromInvCode) fromInvName,
(select name from basic_corp bc where bc.erpId = io.fromCorp) fromCorpName, (select name from basic_corp bc where bc.erpId = io.fromCorp) fromCorpName,
@ -99,11 +100,12 @@
</if> </if>
<if test="invoiceActions2 != null and invoiceActions2.size() != 0"> <if test="invoiceActions2 != null and invoiceActions2.size() != 0">
or ( or (
`action` in `action` in
<foreach collection="invoiceActions2" index="index" item="item" open="(" close=")" separator=","> <foreach collection="invoiceActions2" index="index" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> and status = 7 </foreach>
) and status = 7
)
</if> </if>
</if> </if>
</where> </where>
@ -151,7 +153,8 @@
AND busType = #{busType} AND busType = #{busType}
</if> </if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and
date_format(#{endTime}, '%Y-%m-%d')
</if> </if>
</where> </where>
order by createTime desc order by createTime desc
@ -183,6 +186,7 @@
(select employeeName from auth_user au where au.id = io.createUser) createUserName, (select employeeName from auth_user au where au.id = io.createUser) createUserName,
(select employeeName from auth_user au2 where au2.id = io.updateUser) updateUserName, (select employeeName from auth_user au2 where au2.id = io.updateUser) updateUserName,
(select employeeName from auth_user au3 where au3.id = io.reviewUser) reviewUserName, (select employeeName from auth_user au3 where au3.id = io.reviewUser) reviewUserName,
(select employeeName from auth_user au4 where au4.id = io.checkUser) checkUserName,
(select name from auth_dept ad2 where ad2.code = io.fromDeptCode) fromDeptName, (select name from auth_dept ad2 where ad2.code = io.fromDeptCode) fromDeptName,
(select name from auth_warehouse aw2 where aw2.code = io.fromInvCode) fromInvName, (select name from auth_warehouse aw2 where aw2.code = io.fromInvCode) fromInvName,
(select name from basic_corp bc where bc.erpId = io.fromCorp) fromCorpName, (select name from basic_corp bc where bc.erpId = io.fromCorp) fromCorpName,
@ -206,7 +210,8 @@
AND invCode = #{invCode} AND invCode = #{invCode}
</if> </if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and
date_format(#{endTime}, '%Y-%m-%d')
</if> </if>
<if test="startTime != null and startTime != '' and (endTime == null or endTime == '')"> <if test="startTime != null and startTime != '' and (endTime == null or endTime == '')">
AND date_format(createTime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') AND date_format(createTime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d')

@ -7,10 +7,11 @@
(select name from basic_bussiness_type bus where bus.action = io.action) billTypeName, (select name from basic_bussiness_type bus where bus.action = io.action) billTypeName,
(select name from auth_dept ad where ad.code = io.deptCode) deptName, (select name from auth_dept ad where ad.code = io.deptCode) deptName,
(select name from auth_warehouse aw where aw.code = io.invCode) invName, (select name from auth_warehouse aw where aw.code = io.invCode) invName,
( SELECT fromType FROM io_order ior WHERE ior.billNo = io.billNo ) orderFromType, (SELECT fromType FROM io_order ior WHERE ior.billNo = io.billNo) orderFromType,
(select employeeName from auth_user au where au.id = io.createUser) createUserName, (select employeeName from auth_user au where au.id = io.createUser) createUserName,
(select employeeName from auth_user au2 where au2.id = io.updateUser) updateUserName, (select employeeName from auth_user au2 where au2.id = io.updateUser) updateUserName,
(select employeeName from auth_user au3 where au3.id = io.reviewUser) reviewUserName, (select employeeName from auth_user au3 where au3.id = io.reviewUser) reviewUserName,
(select employeeName from auth_user au4 where au4.id = io.checkUser) checkUserName,
(select name from basic_corp bc where bc.erpId = io.fromCorp) fromCorpName (select name from basic_corp bc where bc.erpId = io.fromCorp) fromCorpName
from inv_prein_order as io from inv_prein_order as io
<where> <where>
@ -22,7 +23,7 @@
</if> </if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and
date_format(#{endTime}, '%Y-%m-%d') date_format(#{endTime}, '%Y-%m-%d')
</if> </if>
<if test="startTime != null and startTime != '' and (endTime == null or endTime == '')"> <if test="startTime != null and startTime != '' and (endTime == null or endTime == '')">
AND date_format(createTime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') AND date_format(createTime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d')

@ -10,6 +10,8 @@ CALL Pro_Temp_ColumnWork('io_order', 'processStatus', 'tinyint ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'suppleCount', 'tinyint ', 1); CALL Pro_Temp_ColumnWork('io_order', 'suppleCount', 'tinyint ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'relKey', 'varchar(255) ', 1); CALL Pro_Temp_ColumnWork('io_order', 'relKey', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'checkTime', 'datetime ', 1); CALL Pro_Temp_ColumnWork('io_order', 'checkTime', 'datetime ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'checkUser', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('io_code_lost', 'nameCode', 'varchar(255) ', 1); CALL Pro_Temp_ColumnWork('io_code_lost', 'nameCode', 'varchar(255) ', 1);

Loading…
Cancel
Save