Merge remote-tracking branch 'origin/master'

master
chengqf 2 years ago
commit 7dbf8a73ca

@ -162,6 +162,7 @@ public class DeptController extends BaseController {
List<DeptEntity> invWarehouseEntities;
AuthAdmin authAdmin = customerService.getUserBean();
if (authAdmin.getCustomerId().equals("110")) {
filterInvWarehouseRequest.setCustomerId("110");
filterInvWarehouseRequest.setUserId(authAdmin.getId());
} else {
filterInvWarehouseRequest.setUserId(null);
@ -249,12 +250,12 @@ public class DeptController extends BaseController {
}
//判断状态
String msg=isCheckStatus(deptEntity.getStatus(),deptEntity);
if(msg!=""){
return ResultVOUtils.error(999,msg);
String msg = isCheckStatus(deptEntity.getStatus(), deptEntity);
if (msg != "") {
return ResultVOUtils.error(999, msg);
}
//判断供应商状态
if(deptEntity.isSpUse()==false){
if (deptEntity.getSpUse() == false) {
FilterDeptUserReqeust filterDeptUserReqeust = new FilterDeptUserReqeust();
filterDeptUserReqeust.setDeptId(deptEntity.getId().longValue());
List<DeptUserEntity> deptUserEntities = deptUserService.selectDeptUser(filterDeptUserReqeust);
@ -294,8 +295,8 @@ public class DeptController extends BaseController {
}
DeptEntity deptEntity = deptService.selectById(deleteRequest.getId());
if(deptEntity.getLevel()!=null && deptEntity.getLevel() == 1){
return ResultVOUtils.error(500,"删除失败,一级部门不允许删除!");
if (deptEntity.getLevel() != null && deptEntity.getLevel() == 1) {
return ResultVOUtils.error(500, "删除失败,一级部门不允许删除!");
}
List<InvWarehouseEntity> invSubWarehouseEntities = invWarehouseService.findByParentId(deptEntity.getCode());
@ -309,7 +310,7 @@ public class DeptController extends BaseController {
return ResultVOUtils.error(500, "删除失败,请先移除该部门关联用户信息!");
}
List<DeptEntity> deptEntities = deptService.selectByPcode(deptEntity.getCode());
if(deptEntities.size()>0){
if (deptEntities.size() > 0) {
return ResultVOUtils.error(500, "删除失败,请先移除该部门下的子部门!");
}
@ -365,20 +366,20 @@ public class DeptController extends BaseController {
return ResultVOUtils.success(list);
}
public String isCheckStatus(Integer status,DeptEntity deptEntity){
public String isCheckStatus(Integer status, DeptEntity deptEntity) {
//启用的时候需要判断上级是不是被禁用
if(status==1){
if (status == 1) {
//查询所有的上级
List<DeptEntity> deptEntityList= deptService.selectupDeptAll(deptEntity.getPcode());
for(DeptEntity obj:deptEntityList){
if(obj.getStatus()==0){
List<DeptEntity> deptEntityList = deptService.selectupDeptAll(deptEntity.getPcode());
for (DeptEntity obj : deptEntityList) {
if (obj.getStatus() == 0) {
return "上级存在禁用的部门修改失败!";
}
}
}else{
List<DeptEntity> deptEntityList= deptService.selectLowDeptAll(deptEntity.getCode());
for(DeptEntity obj:deptEntityList){
if(obj.getStatus()==1){
} else {
List<DeptEntity> deptEntityList = deptService.selectLowDeptAll(deptEntity.getCode());
for (DeptEntity obj : deptEntityList) {
if (obj.getStatus() == 1) {
return "下级存在启用的部门修改失败!";
}
}

@ -84,6 +84,9 @@ public class InvWarehouseController extends BaseController {
if (authAdmin.getCustomerId().equals("110")) {
filterInvWarehouseRequest.setUserId(authAdmin.getId());
} else {
if(filterInvWarehouseRequest.getType()==1){
filterInvWarehouseRequest.setSpUse(true);
}
filterInvWarehouseRequest.setUserId(null);
}

@ -647,6 +647,7 @@ public class IoCodeTempController extends BaseController {
boolean isBillExit = orderDetailBizService.isExit(orderEntity.getBillNo());
if (!isBillExit) {
orderService.deleteByBillNo(orderEntity.getBillNo());
return ResultVOUtils.error(500, "请先录入业务详情");
}
}
@ -960,6 +961,13 @@ public class IoCodeTempController extends BaseController {
}
}
boolean r1 = orderDetailBizService.isExit(orderDetailCodeEntity.getOrderIdFk());
boolean r2 = ioOrderDetailCodeService.isExit(orderDetailCodeEntity.getOrderIdFk());
if (!r1 && !r2) {
orderService.deleteByBillNo(orderDetailCodeEntity.getOrderIdFk());
}
orderEntity.setUpdateUser(getUserId() + "");
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);

@ -121,7 +121,8 @@ public class IoOrderDetailBizController extends BaseController {
if (addBizProductReqeust.getOrderEntity() == null)
return ResultVOUtils.error(500, "未指定订单");
IoOrderEntity orderEntity = addBizProductReqeust.getOrderEntity();
if (StrUtil.isEmpty(orderEntity.getBillNo())) {
IoOrderEntity isExit = orderService.findByBillNo(orderEntity.getBillNo());
if (StrUtil.isEmpty(orderEntity.getBillNo()) || isExit == null) {
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode(orderEntity.getInvCode());
String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix()), "yyyyMMdd"));
@ -472,7 +473,19 @@ public class IoOrderDetailBizController extends BaseController {
@PostMapping("/udiwms/inout/order/delBizProduct")
@Log(title = "单据管理", businessType = BusinessType.DELETE)
public BaseResponse delBizProduct(@RequestBody DeleteRequest deleteRequest) {
return orderDetailBizService.deleteById(Integer.parseInt(deleteRequest.getId())) > 0 ? ResultVOUtils.success("删除成功!") : ResultVOUtils.error(500, "删除失败");
IoOrderDetailBizEntity orderDetailBizEntity = orderDetailBizService.selectById(Integer.parseInt(deleteRequest.getId()));
int result = orderDetailBizService.deleteById(Integer.parseInt(deleteRequest.getId()));
if (result > 0) {
boolean r1 = orderDetailBizService.isExit(orderDetailBizEntity.getOrderIdFk());
boolean r2 = orderDetailCodeService.isExit(orderDetailBizEntity.getOrderIdFk());
if (!r1 && !r2) {
orderService.deleteByBillNo(orderDetailBizEntity.getOrderIdFk());
}
return ResultVOUtils.success("删除成功!");
}
return ResultVOUtils.error(500, "删除失败");
}

@ -20,14 +20,18 @@ import com.glxp.api.entity.inout.*;
import com.glxp.api.entity.system.SystemParamConfigEntity;
import com.glxp.api.req.inout.FilterOrderDetailResultRequest;
import com.glxp.api.req.inout.ReviewFinishRequest;
import com.glxp.api.req.inout.ReviewSpmsRequest;
import com.glxp.api.req.inout.UpdateExportStatusRequest;
import com.glxp.api.req.sync.SpsSyncDataRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.inout.AcceptOrderResponse;
import com.glxp.api.res.inout.IoOrderDetailResultResponse;
import com.glxp.api.res.sync.SpsSyncOrderResponse;
import com.glxp.api.service.auth.AuthAdminService;
import com.glxp.api.service.basic.EntrustReceService;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.service.inout.*;
import com.glxp.api.service.sync.SpsSyncDownloadService;
import com.glxp.api.service.system.SystemParamConfigService;
import com.glxp.api.util.CustomUtil;
import com.glxp.api.util.GennerOrderUtils;
@ -414,4 +418,30 @@ public class IoOrderReviewController extends BaseController {
return ResultVOUtils.success("更新成功");
}
@Resource
SpsSyncDownloadService spsSyncDownloadService;
// UDI管理系统获取验收单据信息
@AuthRuleAnnotation("")
@PostMapping("/udiwms/order/getReviews")
public BaseResponse getReviewOrderSpms(@RequestBody ReviewSpmsRequest reviewSpmsRequest) {
String billNo = reviewSpmsRequest.getBillNo();
if (StrUtil.isEmpty(reviewSpmsRequest.getBillNo())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
IoOrderEntity orderEntity = orderService.findByBillNo(reviewSpmsRequest.getBillNo());
if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_AUDITED) {
return ResultVOUtils.error(500, "单据已审核!");
} else if (orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_CHECK_REW) {
return ResultVOUtils.error(500, "当前单据不处于待审核状态,无法审核!");
}
SpsSyncDataRequest spsSyncDataRequest = new SpsSyncDataRequest();
spsSyncDataRequest.setBillNo(reviewSpmsRequest.getBillNo());
return spsSyncDownloadService.findOrder(spsSyncDataRequest);
}
}

@ -244,7 +244,6 @@ public class SpsSyncDownloadController {
orderEntity.setId(null);
purOrderService.insert(orderEntity);
if (CollUtil.isNotEmpty(spsSyncBusOrderResponse.getPurOrderDetailEntities())) {
List<PurOrderDetailEntity> purOrderDetailEntities = spsSyncBusOrderResponse.getPurOrderDetailEntities();
for (PurOrderDetailEntity purOrderDetailEntity : purOrderDetailEntities) {
PurOrderDetailEntity codeTempEntity = new PurOrderDetailEntity();
@ -278,5 +277,11 @@ public class SpsSyncDownloadController {
}
//接收中继服务、UDI管理系统上传单据类型
//接收中继服务、UDI管理系统上传基础信息
}

@ -172,18 +172,17 @@ public class ThrProductsAddDiController {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
String remark=thrProductsAddDiEntity.getRemark();
Integer status=thrProductsAddDiEntity.getStatus();
thrProductsAddDiEntity.setAuditTime(new Date());
thrProductsAddDiEntity.setAuditUser(customerService.getUserId() + "");
thrProductsAddDiService.updateDiProduct(thrProductsAddDiEntity);
thrProductsAddDiEntity = thrProductsAddDiService.selecById(thrProductsAddDiEntity.getId());
//自增的数据就再到第三方产品里面
ThrProductsAddDiResponse thrProductsAddDiResponse = thrProductsAddDiService.selecById(thrProductsAddDiEntity.getId());
if (thrProductsAddDiEntity.getStatus() == 2) { //审核通过
if (status == 2) { //审核通过
//第三方产品审核通过
if (thrProductsAddDiEntity.getType() == 2) {
ThrProductsEntity thrProductsEntity = new ThrProductsEntity();
@ -255,8 +254,13 @@ public class ThrProductsAddDiController {
}
}
}
thrProductsAddDiEntity.setRemark(remark);
thrProductsAddDiEntity.setStatus(status);
thrProductsAddDiService.updateDiProduct(thrProductsAddDiEntity);
}else {
thrProductsAddDiEntity.setRemark(remark);
thrProductsAddDiEntity.setStatus(status);
thrProductsAddDiService.updateDiProduct(thrProductsAddDiEntity);
}
return ResultVOUtils.success("更新成功");
}

@ -28,6 +28,6 @@ public class DeptEntity {
private String thirdId3;
private String thirdId4;
private boolean spUse;
private Boolean spUse;
}

@ -203,7 +203,7 @@ public class IdcServiceImpl implements IdcService {
}
}
private void fetchFailFile(String host) {
Map<String,Object> map = new HashMap<String,Object>();
map.put("sql", "select * from idc_file where createTime<date_sub(now(),interval 30 minute) order by createTime");
@ -579,7 +579,7 @@ public class IdcServiceImpl implements IdcService {
Map<String, Object> whereParams = new HashMap<String, Object>();
whereParams.put("sqlWhere", params.get("sqlWhere"));
String dataWhere = params.get("dataWhere")!=null ? params.get("dataWhere").toString() : "";
Map<String, Object> map = new HashMap<String, Object>();
String where = DBAUtils.convertWhere(column, whereParams, dataWhere);
@ -811,7 +811,7 @@ public class IdcServiceImpl implements IdcService {
private boolean analyToDB(String host, String tableName, String uniqueColumn, String
filePathColumn, List<Map<String, Object>> list, boolean isUpload) {
String tName = DBAUtils.tableRealName(tableName);
String sql = "replace " + tName + "(";
String del = "delete from " + tName + " where ";
@ -1034,27 +1034,27 @@ public class IdcServiceImpl implements IdcService {
int total = 0;
if (result!=null&&result.isSuccessful()&&MediaType.parse("application/force-download").equals(result.body().contentType())) {
try (InputStream inputStream = result.body().byteStream()) {
FileOutputStream outputStream = new FileOutputStream(filePath + filePathSlash + imagePath+fileName);
byte b[] = new byte[1024];
int len = 0;
while ((len = inputStream.read(b)) != -1) {
total += len;
outputStream.write(b, 0, len);
}
outputStream.flush();
outputStream.close();
if(!(total>0)) {
new File(filePath + filePathSlash + imagePath+fileName).delete();
executeSql("delete from idc_file where filePath='"+fileName+"'");
}
FileOutputStream outputStream = new FileOutputStream(filePath + filePathSlash + imagePath+fileName);
byte b[] = new byte[1024];
int len = 0;
while ((len = inputStream.read(b)) != -1) {
total += len;
outputStream.write(b, 0, len);
}
outputStream.flush();
outputStream.close();
if(!(total>0)) {
new File(filePath + filePathSlash + imagePath+fileName).delete();
executeSql("delete from idc_file where filePath='"+fileName+"'");
}
} catch (Exception e) {
@ -1252,7 +1252,7 @@ public class IdcServiceImpl implements IdcService {
}
private void executeSql(String sql) {
try {
jdbcTemplate.execute(sql);
@ -1262,5 +1262,5 @@ public class IdcServiceImpl implements IdcService {
}
}
}
}

@ -31,4 +31,6 @@ public class FilterInvWarehouseRequest extends ListPageRequest {
private String superiorCode;//上级
private String subordinateCode;//下级
private String superiorPcode;//上级
private String CustomerId;
private Integer type;
}

@ -0,0 +1,10 @@
package com.glxp.api.req.inout;
import lombok.Data;
@Data
public class ReviewSpmsRequest {
private String billNo;
}

@ -59,4 +59,8 @@ public class FilterInvRemindMsgRequest extends ListPageRequest {
*/
private String supId;
/**
*
*/
private String productName;
}

@ -6,5 +6,6 @@ import lombok.Data;
@Data
public class SpsSyncDataRequest extends ListPageRequest {
private String billNo;
private String lastUpdateTime;
}

@ -0,0 +1,18 @@
package com.glxp.api.res.sync;
import com.glxp.api.entity.basic.BasicBusTypeChangeEntity;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.entity.thrsys.ThrBusTypeOriginEntity;
import lombok.Data;
import java.util.List;
@Data
public class SpsSyncBusResponse {
//同步任务ID
private String taskId;
private List<BasicBussinessTypeEntity> bussinessTypeEntities;
private List<BasicBusTypeChangeEntity> busTypeChangeEntities;
private List<ThrBusTypeOriginEntity> thrBusTypeOriginEntities;
}

@ -0,0 +1,33 @@
package com.glxp.api.res.sync;
import com.glxp.api.entity.auth.*;
import lombok.Data;
import java.util.List;
@Data
public class SpsSyncDataResponse {
//同步任务ID
private String taskId;
//用户信息
List<AuthAdmin> authAdminList;
List<InvBusUserEntity> invBusUserEntities;
//部门信息
List<DeptEntity> deptEntityList;
List<DeptUserEntity> deptUserEntities;
//仓库相关
List<InvWarehouseEntity> invWarehouseEntities;
List<WarehouseBussinessTypeEntity> warehouseBussinessTypeEntities;
List<WarehouseUserEntity> warehouseUserEntities;
//货位信息
List<InvSpace> invSpaces;
}

@ -412,7 +412,7 @@ public class IoOrderServiceImpl implements IoOrderService {
orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK_SUCCESS);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK_REW);
orderEntity.setUpdateTime(new Date());
update(orderEntity);
return true;

@ -1,6 +1,7 @@
package com.glxp.api.service.sync;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BasicProcessStatus;
@ -76,19 +77,26 @@ public class SpsSyncDownloadService {
public BaseResponse findOrder(SpsSyncDataRequest spsSyncDataRequest) {
SpsSyncOrderResponse syncOrderResponse = new SpsSyncOrderResponse();
//查询数据同步设置
SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet();
List<IoOrderEntity> orderEntities = new ArrayList<>();
FilterOrderRequest orderFilterRequest = new FilterOrderRequest();
BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest);
if (CollUtil.isNotEmpty(syncDataSetEntity.getBusTypes())) {
for (SyncDataBustypeEntity syncDataBustypeEntity : syncDataSetEntity.getBusTypes()) {
List<IoOrderEntity> temps = orderService.findByStatus(syncDataBustypeEntity.getAction(), syncDataBustypeEntity.getOrderStatus(), DateUtil.parseDate(spsSyncDataRequest.getLastUpdateTime()));
if (CollUtil.isNotEmpty(temps)) {
orderEntities.addAll(temps);
if (StrUtil.isEmpty(spsSyncDataRequest.getBillNo())) {
SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet();
FilterOrderRequest orderFilterRequest = new FilterOrderRequest();
BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest);
if (CollUtil.isNotEmpty(syncDataSetEntity.getBusTypes())) {
for (SyncDataBustypeEntity syncDataBustypeEntity : syncDataSetEntity.getBusTypes()) {
List<IoOrderEntity> temps = orderService.findByStatus(syncDataBustypeEntity.getAction(), syncDataBustypeEntity.getOrderStatus(), DateUtil.parseDate(spsSyncDataRequest.getLastUpdateTime()));
if (CollUtil.isNotEmpty(temps)) {
orderEntities.addAll(temps);
}
}
}
} else {
IoOrderEntity orderEntity = orderService.findByBillNo(spsSyncDataRequest.getBillNo());
orderEntities.add(orderEntity);
}
syncOrderResponse.setOrderEntities(orderEntities);
List<IoCodeEntity> codeEntities = new ArrayList<>();
List<IoOrderDetailBizEntity> orderDetailBizEntities = new ArrayList<>();

@ -47,7 +47,9 @@
resultType="com.glxp.api.entity.auth.DeptEntity">
select auth_dept.* from auth_dept INNER JOIN auth_warehouse
on auth_dept.`code` =auth_warehouse.parentId
INNER JOIN auth_warehouse_user on auth_warehouse_user.`code` = auth_warehouse.code
<if test="CustomerId != '' and CustomerId != null">
INNER JOIN auth_warehouse_user on auth_warehouse_user.`code` = auth_warehouse.code
</if>
<where>
<if test="id != '' and id != null">
AND id = #{id}

@ -156,6 +156,11 @@
AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and
date_format(#{endTime}, '%Y-%m-%d')
</if>
<if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[
and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
order by createTime desc
</select>

@ -28,8 +28,8 @@
(select `name` from auth_space where `code` = irm.invSpaceCode and invCode = irm.invCode) invSpaceName,
(select `name` from basic_corp where erpId = irm.supId) supName
from inv_remind_msg irm
left join basic_udirel bu on bu.id = irm.relId
left join basic_products bp on bp.uuid = bu.uuid
left join basic_udirel bu on bu.id = irm.relId
left join basic_products bp on bp.uuid = bu.uuid
<where>
<if test="relId != null and relId != ''">
AND irm.relId = #{relId}
@ -50,7 +50,7 @@
AND irm.ignoreStatus = #{ignoreStatus}
</if>
<if test="ggxh != null and ggxh != ''">
AND bp.ggxh = #{ggxh}
AND bp.ggxh like concat('%', #{ggxh}, '%')
</if>
<if test="type != null and type != ''">
AND type = #{type}
@ -58,6 +58,9 @@
<if test="supId != null">
AND irm.supId = #{supId}
</if>
<if test="productName != null and productName != ''">
AND bp.cpmctymc like concat('%', #{productName}, '%')
</if>
</where>
order by irm.updateTime desc
</select>

@ -252,9 +252,9 @@
ip.productionDate,
ip.expireDate,
ip.supId,
sum(ip.inCount) incount,
sum(ip.outCount) outCount,
sum(ip.reCount) reCount
ip.inCount,
ip.outCount,
ip.reCount
from inv_product ip
left join inv_product_detail ipd
on ip.relIdFk = ipd.relId and ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')

@ -22,6 +22,11 @@ CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'bindRlIds', 'varchar(255) ', 1)
CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'checkFileName', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('io_order_invoice', 'bizIdFk', 'int ', 1);
CALL Pro_Temp_ColumnWork('thr_products', 'updateUser', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('thr_products', 'createUser', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('thr_products', 'createTime', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('auth_warehouse', 'advanceType', 'tinyint', 1);

Loading…
Cancel
Save