1.调整单据流转接口

master
x_z 2 years ago
parent 5fd7c291d0
commit b5f30ce1c4

@ -23,7 +23,7 @@ import java.util.Date;
import java.util.List;
/**
*
*
*/
@Slf4j
@RestController
@ -33,7 +33,7 @@ public class BasicBusTypeChangeController {
private IBasicBusTypeChangeService basicBusTypeChangeService;
/**
*
*
*
* @param basicBusTypeChangeRequest
* @param bindingResult
@ -51,7 +51,7 @@ public class BasicBusTypeChangeController {
}
/**
*
*
*
* @param basicBusTypeChangeEntity
* @param bindingResult
@ -68,7 +68,7 @@ public class BasicBusTypeChangeController {
}
/**
*
*
*
* @param basicBusTypeChangeEntity
* @param bindingResult
@ -85,7 +85,7 @@ public class BasicBusTypeChangeController {
}
/**
*
*
*
* @param deleteRequest
* @param bindingResult

@ -14,6 +14,7 @@ import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.req.basic.FilterBusTypeChangeRequest;
import com.glxp.api.req.basic.FilterBusTypePreRequest;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.res.basic.BasicBusTypePreResponse;
import com.glxp.api.service.auth.InvWarehouseService;
import com.glxp.api.service.basic.IBasicBusTypePreService;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
@ -28,7 +29,7 @@ import javax.annotation.Resource;
import java.util.List;
/**
*
*
*/
@Slf4j
@RestController
@ -42,7 +43,7 @@ public class BasicBusTypePreController {
private InvWarehouseService invWarehouseService;
/**
*
*
*
* @param filterBusTypePreRequest
* @return
@ -53,7 +54,7 @@ public class BasicBusTypePreController {
BasicBussinessTypeEntity basicBussinessType = basicBussinessTypeService.findByAction(filterBusTypePreRequest.getAction());
List<BasicBusTypePreEntity> basicBusTypePreEntities = basicBusTypePreService.findByAction(filterBusTypePreRequest.getAction());
if (CollUtil.isEmpty(basicBusTypePreEntities)) {
//创建对应补单设置
//创建对应单据流转
if (filterBusTypePreRequest.getType() != null && "changEnable".equals(filterBusTypePreRequest.getType())) {
if (ConstantType.TYPE_OUT.equals(basicBussinessType.getMainAction()) && !basicBussinessType.isAdvanceType()) {
BasicBusTypePreEntity basicBusTypePreEntity = new BasicBusTypePreEntity();
@ -77,7 +78,7 @@ public class BasicBusTypePreController {
}
/**
*
*
*
* @param busTypeChangeFilterRequest
* @param bindingResult
@ -93,6 +94,23 @@ public class BasicBusTypePreController {
return ResultVOUtils.page(pageInfo);
}
/**
*
*
* @param filterBusTypePreRequest
* @param bindingResult
* @return
*/
@GetMapping("/spms/busTypePre/filterBusTypePreRes")
public BaseResponse filterBusTypePreResList(FilterBusTypePreRequest filterBusTypePreRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<BasicBusTypePreResponse> list = basicBusTypePreService.filterBusTypePreResList(filterBusTypePreRequest);
PageInfo<BasicBusTypePreResponse> pageInfo = new PageInfo<>(list);
return ResultVOUtils.page(pageInfo);
}
/**
* ID
*

@ -15,6 +15,7 @@ import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.res.basic.BasicBussinessTypeResponse;
import com.glxp.api.res.basic.BussinessTypExportResponse;
import com.glxp.api.res.basic.CandidateRequest;
import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.util.CustomUtil;
import com.glxp.api.util.FileUtils;
@ -42,6 +43,8 @@ public class BasicBussinessTypeController {
@Resource
private IBasicBussinessTypeService basicBussinessTypeService;
@Resource
private CustomerService customerService;
/**
*
@ -56,6 +59,24 @@ public class BasicBussinessTypeController {
return ResultVOUtils.page(pageInfo);
}
/**
*
*
* @param filterBussinessTypeRequest
* @param bindingResult
* @return
*/
@GetMapping("/udiwms/localBusType/filterByUser")
public BaseResponse filterByUser(FilterBussinessTypeRequest filterBussinessTypeRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
filterBussinessTypeRequest.setUserId(customerService.getUserId());
List<BasicBussinessTypeEntity> list = basicBussinessTypeService.filterByUser(filterBussinessTypeRequest);
PageInfo<BasicBussinessTypeEntity> pageInfo = new PageInfo<>(list);
return ResultVOUtils.page(pageInfo);
}
/**
*
*

@ -3,6 +3,8 @@ package com.glxp.api.dao.basic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.basic.BasicBusTypePreEntity;
import com.glxp.api.req.basic.FilterBusTypeChangeRequest;
import com.glxp.api.req.basic.FilterBusTypePreRequest;
import com.glxp.api.res.basic.BasicBusTypePreResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -31,4 +33,13 @@ public interface BasicBusTypePreDao extends BaseMapper<BasicBusTypePreEntity> {
* @return
*/
List<BasicBusTypePreEntity> findByAction(String action);
/**
*
*
* @param filterBusTypePreRequest
* @return
*/
List<BasicBusTypePreResponse> selectBusTypePreResList(FilterBusTypePreRequest filterBusTypePreRequest);
}

@ -51,4 +51,13 @@ public interface BasicBussinessTypeDao extends BaseMapper<BasicBussinessTypeEnti
* @return
*/
List<BasicBussinessTypeEntity> selectCandidateBusType(@Param("mainAction") String mainAction);
/**
*
*
* @param filterBussinessTypeRequest
* @return
*/
List<BasicBussinessTypeEntity> selectByUser(FilterBussinessTypeRequest filterBussinessTypeRequest);
}

@ -14,11 +14,6 @@ public class FilterBusTypeChangeRequest extends ListPageRequest {
*/
private String originAction;
/**
* 0:1:
*/
private Boolean enable;
/**
*
*/

@ -21,4 +21,21 @@ public class FilterBusTypePreRequest extends ListPageRequest {
private String type;
/**
*
*/
private String originAction;
/**
*
*/
private String originName;
/**
*
*/
private String targetName;
private String name;
}

@ -7,12 +7,12 @@ import com.glxp.api.res.basic.BasicBusTypeChangeResponse;
import java.util.List;
/**
* Service
* Service
*/
public interface IBasicBusTypeChangeService {
/**
*
*
*
* @param filterBusTypeChangeRequest
* @return
@ -20,7 +20,7 @@ public interface IBasicBusTypeChangeService {
List<BasicBusTypeChangeResponse> filterList(FilterBusTypeChangeRequest filterBusTypeChangeRequest);
/**
*
*
*
* @param basicBusTypeChangeEntity
* @return
@ -28,14 +28,14 @@ public interface IBasicBusTypeChangeService {
int insert(BasicBusTypeChangeEntity basicBusTypeChangeEntity);
/**
*
*
*
* @param basicBusTypeChangeEntity
*/
boolean updateBasicBusTypeChange(BasicBusTypeChangeEntity basicBusTypeChangeEntity);
/**
*
*
*
* @param id
*/

@ -2,6 +2,8 @@ package com.glxp.api.service.basic;
import com.glxp.api.entity.basic.BasicBusTypePreEntity;
import com.glxp.api.req.basic.FilterBusTypeChangeRequest;
import com.glxp.api.req.basic.FilterBusTypePreRequest;
import com.glxp.api.res.basic.BasicBusTypePreResponse;
import java.util.List;
@ -59,4 +61,13 @@ public interface IBasicBusTypePreService {
* @return
*/
List<BasicBusTypePreEntity> findByAction(String action);
/**
*
*
* @param filterBusTypePreRequest
* @return
*/
List<BasicBusTypePreResponse> filterBusTypePreResList(FilterBusTypePreRequest filterBusTypePreRequest);
}

@ -85,8 +85,17 @@ public interface IBasicBussinessTypeService {
/**
*
*
* @return
*/
List<BasicBussinessTypeEntity> filterForThirdSys();
/**
*
*
* @param filterBussinessTypeRequest
* @return
*/
List<BasicBussinessTypeEntity> filterByUser(FilterBussinessTypeRequest filterBussinessTypeRequest);
}

@ -4,6 +4,8 @@ import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.basic.BasicBusTypePreDao;
import com.glxp.api.entity.basic.BasicBusTypePreEntity;
import com.glxp.api.req.basic.FilterBusTypeChangeRequest;
import com.glxp.api.req.basic.FilterBusTypePreRequest;
import com.glxp.api.res.basic.BasicBusTypePreResponse;
import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.basic.IBasicBusTypePreService;
import lombok.extern.slf4j.Slf4j;
@ -11,6 +13,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@ -59,6 +62,17 @@ public class BasicBusTypePreServiceImpl implements IBasicBusTypePreService {
return basicBusTypePreDao.findByAction(action);
}
@Override
public List<BasicBusTypePreResponse> filterBusTypePreResList(FilterBusTypePreRequest filterBusTypePreRequest) {
if (null == filterBusTypePreRequest) {
return Collections.emptyList();
}
if (null != filterBusTypePreRequest.getPage() && null != filterBusTypePreRequest.getLimit()) {
PageHelper.offsetPage((filterBusTypePreRequest.getPage() - 1) * filterBusTypePreRequest.getLimit(), filterBusTypePreRequest.getLimit());
}
return basicBusTypePreDao.selectBusTypePreResList(filterBusTypePreRequest);
}
/**
* /
*

@ -141,6 +141,17 @@ public class BasicBussinessTypeServiceImpl implements IBasicBussinessTypeService
return basicBussinessTypeDao.selectForThirdSys();
}
@Override
public List<BasicBussinessTypeEntity> filterByUser(FilterBussinessTypeRequest filterBussinessTypeRequest) {
if (null == filterBussinessTypeRequest) {
return Collections.emptyList();
}
if (null != filterBussinessTypeRequest.getPage() && null != filterBussinessTypeRequest.getLimit()) {
PageHelper.offsetPage((filterBussinessTypeRequest.getPage() - 1) * filterBussinessTypeRequest.getLimit(), filterBussinessTypeRequest.getLimit());
}
return basicBussinessTypeDao.selectByUser(filterBussinessTypeRequest);
}
/**
* /
*

@ -4,6 +4,11 @@
<select id="selectList" resultType="com.glxp.api.entity.basic.BasicBusTypePreEntity">
select *
from basic_bustype_pre
<where>
<if test="originName != null and originName != ''">
AND originAction like concat('%', #{originAction}, '%')
</if>
</where>
</select>
<delete id="deleteByAction">
@ -21,4 +26,30 @@
left join auth_warehouse on basic_bustype_pre.defaultInvCode = auth_warehouse.code
where basic_bustype_pre.action = #{action}
</select>
<select id="selectBusTypePreResList" resultType="com.glxp.api.res.basic.BasicBusTypePreResponse">
SELECT basic_bustype_pre.*,
awA.name defaultInvName,
awB.name invName,
busTypeA.name originName,
busTypeA.name targetName
FROM basic_bustype_pre
left JOIN auth_warehouse awA on basic_bustype_pre.defaultInvCode = awA.code
left JOIN auth_warehouse awB on basic_bustype_pre.invCode = awB.code
left JOIN basic_bussiness_type busTypeA on basic_bustype_pre.originAction = busTypeA.action
<where>
<if test="action != ''and action != null">
AND basic_bustype_pre.`action` = #{action}
</if>
<if test="originName != ''and originName != null">
AND busTypeA.NAME LIKE CONCAT(#{originName}, '%')
</if>
<if test="targetName != ''and targetName != null">
AND busTypeA.name LIKE CONCAT(#{targetName}, '%')
</if>
<if test="originAction != ''and originAction != null">
AND basic_bustype_pre.`originAction` = #{originAction}
</if>
</where>
</select>
</mapper>

@ -180,4 +180,31 @@
and corpType = 1
and (supplementOrderType is null or supplementOrderType = '')
</select>
<select id="selectByUser" resultType="com.glxp.api.entity.basic.BasicBussinessTypeEntity">
select *
from basic_bussiness_type
inner join inv_bustype_user on basic_bussiness_type.action = inv_bustype_user.scAction
<where>
<if test="name != null and name != ''">
AND basic_bussiness_type.name like concat('%', #{name}, '%')
</if>
<if test="action != null and action != ''">
AND basic_bussiness_type.action like concat('%', #{action}, '%')
</if>
<if test="enable != null">
AND basic_bussiness_type.enable = #{enable}
</if>
<if test="spUse != null">
AND basic_bussiness_type.spUse = #{spUse}
</if>
<if test="code != null and code != ''">
AND inv_bustype_user.subInvCode = #{code}
</if>
<if test="userId != null">
AND inv_bustype_user.userId = #{userId}
</if>
</where>
group by basic_bussiness_type.action
</select>
</mapper>

Loading…
Cancel
Save