Merge remote-tracking branch 'origin/pro' into dev

# Conflicts:
#	src/main/java/com/glxp/api/controller/auth/LoginController.java
pro^2
郑明梁 2 years ago
commit dbcb7bbaf1

@ -18,6 +18,8 @@ import com.glxp.api.req.auth.PCLoginRequest;
import com.glxp.api.req.auth.UpdatePasswordRequest;
import com.glxp.api.res.auth.LoginResponse;
import com.glxp.api.res.auth.LoginUserInfoResponse;
import com.glxp.api.res.inout.ioUploadOrderResponse;
import com.glxp.api.service.inout.IoOrderUtilsService;
import com.glxp.api.res.auth.WebTitleResponse;
import com.glxp.api.service.system.CompanyService;
import com.glxp.api.service.monitor.LogininforService;
@ -26,7 +28,6 @@ import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.service.auth.*;
import com.glxp.api.util.*;
import com.glxp.api.vo.inv.InvWarehouseTreeVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -63,6 +64,12 @@ public class LoginController extends BaseController {
private AuthLicenseDao authLicenseDao;
@Resource
private UserRegisterService userRegisterService;
@Resource
private DeptService deptService;
@Resource
WarehouseBussinessTypeService warehouseBussinessTypeService;
@Resource
IoOrderUtilsService ioOrderUtilsService;
/**
@ -199,8 +206,7 @@ public class LoginController extends BaseController {
return ResultVOUtils.success(map);
}
@Resource
DeptService deptService;
@Resource
InvWarehouseService invWarehouseService;
@ -352,15 +358,46 @@ public class LoginController extends BaseController {
authLicenseDao.romveByCustomerId(authAdmin.getCustomerId() + "");
authLicenseDao.save(authLicense);
}
FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest();
AuthLicense authLicense1 = new AuthLicense();
authLicense1.setAppid(authLicense.getAppid());
authLicense1.setApiKey(authLicense.getApiKey());
authLicense1.setSecretKey(authLicense.getSecretKey());
return ResultVOUtils.success(authLicense1);
}
@GetMapping("/spms/inv/warehouse/filterInv/forUdims")
public BaseResponse forUdims() {
FilterInvWarehouseRequest filterInvWarehouseRequest=new FilterInvWarehouseRequest();
filterInvWarehouseRequest.setSpUse(true);
List<InvWarehouseTreeVo> invList = invWarehouseDao.selectInvListTreeByUser(filterInvWarehouseRequest);
Map<String, Object> res = new WeakHashMap<>(2);
res.put("license", authLicense);
res.put("invList", invList);
return ResultVOUtils.success(res);
List<DeptEntity> data = deptService.filterInvDept(filterInvWarehouseRequest);
return ResultVOUtils.success(data);
}
@GetMapping("/spms/sub/inv/warehouse/getSubInvForUdims")
public BaseResponse getSubInvForUdims(String invCode) {
List<InvWarehouseEntity> data = invWarehouseDao.getByWarePId(invCode);
return ResultVOUtils.success(data);
}
@GetMapping("/udiwms/bussinessType/udimsFilter")
public BaseResponse udimsFilter(String invSubCode) {
List<WarehouseBussinessTypeEntity> data = warehouseBussinessTypeService.filterActionList(invSubCode);
return ResultVOUtils.success(data);
}
@PostMapping("/spms/sub/inv/warehouse/addOrder")
public BaseResponse addOrder(@RequestBody ioUploadOrderResponse ioUploadOrderRespons) {
ioOrderUtilsService.getIoder(ioUploadOrderRespons);
return ResultVOUtils.success();
}
@Value("${WEB_TITLE}")
private String WEB_TITLE;

@ -0,0 +1,77 @@
package com.glxp.api.controller.inout;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.idc.utils.IDCUtils;
import com.glxp.api.util.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.ArrayList;
@RestController
public class IoOrderUploadController {
private static final Logger logger = LoggerFactory.getLogger(IoOrderUploadController.class);
@Value("${file_path}")
private String filePath;
@Value("${API_KEY}")
private String apiKey;
@Value("${API_SECRET}")
private String apiSecret;
private String imagePath = "register/file/image2/";
String pdfPath = "pdf/template/";
@RequestMapping(value = "/udiwms/file/uploadFile")
public BaseResponse uploadFile(HttpServletRequest request,
@RequestParam(value = "content" , required = false) String content,
@RequestParam(value = "files", required = false) MultipartFile[] files) {
//
return receiveFile(request,content,files);
}
public BaseResponse receiveFile(HttpServletRequest request, String content, MultipartFile[] files) {
boolean isRelay = false;
String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : "/";
String host = "";
ArrayList<String> saveFiles = new ArrayList<>();
if (files != null) {
if (!FileUtils.makeDirectory(filePath + filePathSlash + imagePath))
IDCUtils.createDirectory(filePath + filePathSlash + imagePath);
try {
for (MultipartFile file : files) {
String flodPath;
if (file.getName().contains(".jrxml") || file.getName().contains(".jasper")) {
flodPath = pdfPath;
} else {
flodPath = imagePath;
}
String imageName = filePath + filePathSlash + flodPath + file.getOriginalFilename();
saveFiles.add(imageName);
IDCUtils.writeFile(file.getBytes(), filePath + filePathSlash + flodPath, file.getOriginalFilename());
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return ResultVOUtils.success(null);
}
}

@ -77,4 +77,6 @@ public interface DeptDao extends BaseMapperPlus<DeptDao, DeptEntity, DeptEntity>
List<DeptEntity> selectupDeptAll(@Param("pcode") String pCode);
List<DeptEntity> selectLowDeptAll(@Param("pcode") String pCode);
}

@ -36,6 +36,9 @@ public interface InvWarehouseDao extends BaseMapperPlus<InvWarehouseDao, InvWare
List<InvWarehouseEntity> getByWarePcode(@Param("parentCode") String parentCode);
List<InvWarehouseEntity> getByWarePId(@Param("parentId") String parentId);
/**
* parentId
*

@ -40,4 +40,7 @@ public interface WarehouseBussinessTypeDao extends BaseMapperPlus<WarehouseBussi
* @return
*/
List<WarehouseBussinessTypeEntity> selectByActions(@Param("subInvCode") String subInvCode, @Param("actions") List<String> actions);
List<WarehouseBussinessTypeEntity> filterActionList(@Param("code") String code);
}

@ -51,4 +51,7 @@ public interface UdiRlSupDao extends BaseMapperPlus<UdiRlSupDao, UdiRlSupEntity,
* @return
*/
Long selectSupRlCount(CompanyProductRelevanceRequest companyProductRelevanceRequest);
List<UdiRlSupEntity> filterCompanyProduct(FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest);
}

@ -4,6 +4,7 @@ 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 com.fasterxml.jackson.annotation.JsonIdentityReference;
import lombok.Data;
import java.util.Date;

@ -13,4 +13,5 @@ public class FilterCompanyProductRelevanceRequest extends ListPageRequest {
private String unitFk;
private String lastUpdateTime;
private String key;
private String nameCode;
}

@ -0,0 +1,44 @@
package com.glxp.api.res.inout;
import lombok.Data;
/**
*
*/
@Data
public class PlatformLinkResponse {
//往来单位ID
private Long id;
//往来单位编码
private String unitId;
//往来单位名称
private String corpName;
//往来单位类型
private Integer corpType;
//拼音码
private String pinyinCode;
//自助平台名称
private String platformName;
//自助平台ID
private String platformId;
private String socurceName;
//本地单据类型
private String sourceAction;
private String sourceName;
//目标单据类型
private String targetAction;
private String targetName;
private String invCode;
private String invName;
private String invSubCode;
private String invSubName;
private String name;
private String host;
private String appid;
private String secretKey;
}

@ -0,0 +1,18 @@
package com.glxp.api.res.inout;
import com.glxp.api.entity.inout.*;
import lombok.Data;
import java.util.List;
@Data
public class ioUploadOrderResponse {
private List<IoOrderDetailCodeEntity> ioOrderDetailCodeEntityList;
private List<IoCodeTempEntity> ioCodeTempEntityList;
private IoOrderEntity ioOrderEntity;
private PlatformLinkResponse platformLinkRespons;
private List<IoOrderDetailBizEntity> ioOrderDetailBizEntityList;
private List<IoOrderDetailResultEntity> ioOrderDetailResultEntityList;
private List<IoOrderInvoiceEntity> ioOrderInvoiceEntityList;
}

@ -82,4 +82,6 @@ public interface DeptService {
List<DeptEntity> selectLowDeptAll(String pCode);
List<DeptEntity> filterInvDept(FilterInvWarehouseRequest filterInvWarehouseRequest);
}

@ -20,6 +20,7 @@ public interface InvWarehouseService {
List<InvWarehouseEntity> getByWarePcode(@Param("parentCode") String parentCode);
List<InvWarehouseEntity> getByWarePId(@Param("parentId") String parentId);
List<InvWarehouseEntity> filterInvSubWarehouse(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest);

@ -5,6 +5,7 @@ import com.glxp.api.entity.auth.WarehouseBussinessTypeEntity;
import com.glxp.api.req.auth.FilterInvBusTypeRequest;
import com.glxp.api.req.auth.FilterInvLinkDataRequest;
import com.glxp.api.res.basic.BasicBussinessTypeResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -54,4 +55,6 @@ public interface WarehouseBussinessTypeService {
boolean isExitByAction(String action);
List<WarehouseBussinessTypeEntity> filterActionList(String code);
}

@ -192,5 +192,10 @@ public class DeptServiceImpl implements DeptService {
return deptDao.selectLowDeptAll(pCode);
}
@Override
public List<DeptEntity> filterInvDept(FilterInvWarehouseRequest filterInvWarehouseRequest) {
return deptDao.filterGroupInvWarehouse(filterInvWarehouseRequest);
}
}

@ -65,6 +65,11 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
return invWarehouseDao.getByWarePcode(parentCode);
}
@Override
public List<InvWarehouseEntity> getByWarePId(String parentId) {
return invWarehouseDao.getByWarePId(parentId);
}
@Override
public List<InvWarehouseEntity> filterInvSubWarehouse(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest) {
if (filterInvSubWarehouseRequest == null) {

@ -107,4 +107,9 @@ public class WarehouseBussinessTypeServiceImpl implements WarehouseBussinessType
public boolean isExitByAction(String action) {
return warehouseBussinessTypeDao.exists(new QueryWrapper<WarehouseBussinessTypeEntity>().eq("action", action));
}
@Override
public List<WarehouseBussinessTypeEntity> filterActionList(String code) {
return warehouseBussinessTypeDao.filterActionList(code);
}
}

@ -0,0 +1,290 @@
package com.glxp.api.service.inout;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSON;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.Constant;
import com.glxp.api.dao.auth.AuthAdminDao;
import com.glxp.api.dao.basic.UdiRlSupDao;
import com.glxp.api.dao.inout.*;
import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.basic.UdiRlSupEntity;
import com.glxp.api.entity.inout.*;
import com.glxp.api.idc.utils.IDCUtils;
import com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest;
import com.glxp.api.res.inout.PlatformLinkResponse;
import com.glxp.api.res.inout.ioUploadOrderResponse;
import com.glxp.api.util.BeanCopyUtils;
import com.glxp.api.util.FileUtils;
import com.glxp.api.util.GennerOrderUtils;
import com.glxp.api.util.OrderNoTypeBean;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.*;
@Service
public class IoOrderUtilsService {
@Resource
AuthAdminDao authAdminDao;
@Resource
private GennerOrderUtils gennerOrderUtils;
@Resource
private UdiRlSupDao udiRlSupDao;
@Resource
private IoOrderService ioOrderService;
@Resource
private IoOrderDetailCodeDao ioOrderDetailCodeDao;
@Resource
private IoOrderDetailBizDao ioOrderDetailBizDao;
@Resource
private IoCodeTempDao ioCodeTempDao;
@Resource
private IoOrderDetailResultDao ioOrderDetailResultDao;
@Resource
private IoOrderInvoiceMapper ioOrderInvoiceMapper;
@Value("${file_path}")
private String filePath;
public boolean getIoder(ioUploadOrderResponse ioUploadOrderRespons) {
List<IoOrderDetailCodeEntity> ioOrderDetailCodeEntityList = ioUploadOrderRespons.getIoOrderDetailCodeEntityList();
List<IoCodeTempEntity> ioCodeTempEntityList = ioUploadOrderRespons.getIoCodeTempEntityList();
IoOrderEntity ioOrderEntity = ioUploadOrderRespons.getIoOrderEntity();
PlatformLinkResponse platformLinkRespons = ioUploadOrderRespons.getPlatformLinkRespons();
List<IoOrderDetailBizEntity> ioOrderDetailBizEntityList = ioUploadOrderRespons.getIoOrderDetailBizEntityList();
List<IoOrderDetailResultEntity> ioOrderDetailResultEntityList = ioUploadOrderRespons.getIoOrderDetailResultEntityList();
List<IoOrderInvoiceEntity> ioOrderInvoiceEntityList = ioUploadOrderRespons.getIoOrderInvoiceEntityList();
//用来存储耗材字典结果集避免重复查询数据库
Map<String, UdiRlSupEntity> map = new HashMap<>();
Boolean checkUdi = false; //判断是不是有错误
//根据供应商id查询用户id
AuthAdmin authAdmins = authAdminDao.findByCustomerld(platformLinkRespons.getUnitId()).get(0);
//单据表生成
String billNO = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER, "yyyyMMdd"));
//扫码明细表生成
FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest = new FilterCompanyProductRelevanceRequest();
IoCodeTempEntity ioCodeTempEntity1 = new IoCodeTempEntity();
List<IoCodeTempEntity> ioCodeTempEntities = new ArrayList<>();
for (IoCodeTempEntity ioCodeTempEntity : ioCodeTempEntityList) {
//查询物资信息
filterCompanyProductRelevanceRequest.setCustomerId(Long.valueOf(platformLinkRespons.getUnitId()));
filterCompanyProductRelevanceRequest.setNameCode(ioCodeTempEntity.getNameCode());
List<UdiRlSupEntity> udiRlSupEntityList = udiRlSupDao.filterCompanyProduct(filterCompanyProductRelevanceRequest);
if (udiRlSupEntityList != null && udiRlSupEntityList.size() == 0 || udiRlSupEntityList.size() > 1) {
ioCodeTempEntity1.setRelId(null);
checkUdi = true;
} else {
ioCodeTempEntity1.setRelId(udiRlSupEntityList.get(0).getId());
map.put(ioCodeTempEntity.getRelId() + "", udiRlSupEntityList.get(0));
}
ioCodeTempEntity1.setOrderId(billNO);
ioCodeTempEntity1.setCode(ioCodeTempEntity.getCode());
ioCodeTempEntity1.setMainAction(ioCodeTempEntity.getMainAction());
ioCodeTempEntity1.setAction(platformLinkRespons.getTargetAction());
ioCodeTempEntity1.setNameCode(ioCodeTempEntity.getNameCode());
ioCodeTempEntity1.setBatchNo(ioCodeTempEntity.getBatchNo());
ioCodeTempEntity1.setProduceDate(ioCodeTempEntity.getProduceDate());
ioCodeTempEntity1.setExpireDate(ioCodeTempEntity.getExpireDate());
ioCodeTempEntity1.setSerialNo(ioCodeTempEntity.getSerialNo());
ioCodeTempEntity1.setPackageLevel(ioCodeTempEntity.getPackageLevel());
ioCodeTempEntity1.setSupId(ioCodeTempEntity.getSupId());
ioCodeTempEntity1.setCount(ioCodeTempEntity.getCount());
ioCodeTempEntity1.setReCount(ioCodeTempEntity.getReCount());
ioCodeTempEntity1.setDeptCode(platformLinkRespons.getInvCode());
ioCodeTempEntity1.setInvCode(platformLinkRespons.getInvSubCode());
ioCodeTempEntity1.setUpdateTime(new Date());
ioCodeTempEntity1.setCreateTime(new Date());
ioCodeTempEntities.add(ioCodeTempEntity1);
}
//扫码单据生成
IoOrderDetailCodeEntity ioOrderDetailCodeEntity1 = new IoOrderDetailCodeEntity();
List<IoOrderDetailCodeEntity> ioOrderDetailCodeEntities = new ArrayList<>();
for (IoOrderDetailCodeEntity ioOrderDetailCodeEntity : ioOrderDetailCodeEntityList) {
ioOrderDetailCodeEntity1.setOrderIdFk(billNO);
UdiRlSupEntity udiRlSupEntity = map.get(ioOrderDetailCodeEntity.getBindRlFk());
if (udiRlSupEntity != null) {
ioOrderDetailCodeEntity1.setBindRlFk(udiRlSupEntity.getId());
ioOrderDetailCodeEntity1.setUuidFk(udiRlSupEntity.getUdiRlIdFk() + "");
} else {
ioOrderDetailCodeEntity1.setBindRlFk(null);
ioOrderDetailCodeEntity1.setUuidFk(null);
}
ioOrderDetailCodeEntity1.setNameCode(ioOrderDetailCodeEntity.getNameCode());
ioOrderDetailCodeEntity1.setBatchNo(ioOrderDetailCodeEntity.getBatchNo());
ioOrderDetailCodeEntity1.setProductDate(ioOrderDetailCodeEntity.getProductDate());
ioOrderDetailCodeEntity1.setExpireDate(ioOrderDetailCodeEntity.getExpireDate());
ioOrderDetailCodeEntity1.setCoName(ioOrderDetailCodeEntity.getCoName());
ioOrderDetailCodeEntity1.setCertCode(ioOrderDetailCodeEntity.getCertCode());
ioOrderDetailCodeEntity1.setYlqxzcrbarmc(ioOrderDetailCodeEntity.getYlqxzcrbarmc());
ioOrderDetailCodeEntity1.setManufacturer(ioOrderDetailCodeEntity.getManufacturer());
ioOrderDetailCodeEntity1.setMeasname(ioOrderDetailCodeEntity.getMeasname());
ioOrderDetailCodeEntity1.setPrice(ioOrderDetailCodeEntity.getPrice());
ioOrderDetailCodeEntity1.setSpec(ioOrderDetailCodeEntity.getSpec());
ioOrderDetailCodeEntity1.setCertCode(ioOrderDetailCodeEntity.getCertCode());
ioOrderDetailCodeEntity1.setSupId(ioOrderDetailCodeEntity.getSupId());
ioOrderDetailCodeEntity1.setBindSupStatus(ioOrderDetailCodeEntity.getBindSupStatus());
ioOrderDetailCodeEntity1.setCount(ioOrderDetailCodeEntity.getCount());
ioOrderDetailCodeEntity1.setReCount(ioOrderDetailCodeEntity.getReCount());
ioOrderDetailCodeEntity1.setUpdateTime(new Date());
ioOrderDetailCodeEntities.add(ioOrderDetailCodeEntity1);
}
//业务单生成
IoOrderDetailBizEntity ioOrderDetailBizEntity1 = new IoOrderDetailBizEntity();
List<IoOrderDetailBizEntity> ioOrderDetailBizEntities = new ArrayList<>();
if (ioOrderDetailBizEntityList != null && ioOrderDetailBizEntityList.size() > 0) {
for (IoOrderDetailBizEntity ioOrderDetailBizEntity : ioOrderDetailBizEntityList) {
ioOrderDetailBizEntity1.setOrderIdFk(billNO);
UdiRlSupEntity udiRlSupEntity = map.get(ioOrderDetailBizEntity.getBindRlFk());
if (udiRlSupEntity != null) {
ioOrderDetailBizEntity1.setBindRlFk(udiRlSupEntity.getId());
ioOrderDetailBizEntity1.setUuidFk(udiRlSupEntity.getUdiRlIdFk() + "");
} else {
ioOrderDetailBizEntity1.setBindRlFk(null);
ioOrderDetailBizEntity1.setUuidFk(null);
}
ioOrderDetailBizEntity1.setNameCode(ioOrderDetailBizEntity.getNameCode());
ioOrderDetailBizEntity1.setBatchNo(ioOrderDetailBizEntity.getBatchNo());
ioOrderDetailBizEntity1.setProductDate(ioOrderDetailBizEntity.getProductDate());
ioOrderDetailBizEntity1.setExpireDate(ioOrderDetailBizEntity.getExpireDate());
ioOrderDetailBizEntity1.setCoName(ioOrderDetailBizEntity.getCoName());
ioOrderDetailBizEntity1.setCertCode(ioOrderDetailBizEntity.getCertCode());
ioOrderDetailBizEntity1.setYlqxzcrbarmc(ioOrderDetailBizEntity.getYlqxzcrbarmc());
ioOrderDetailBizEntity1.setManufacturer(ioOrderDetailBizEntity.getManufacturer());
ioOrderDetailBizEntity1.setMeasname(ioOrderDetailBizEntity.getMeasname());
ioOrderDetailBizEntity1.setPrice(ioOrderDetailBizEntity.getPrice());
ioOrderDetailBizEntity1.setSpec(ioOrderDetailBizEntity.getSpec());
ioOrderDetailBizEntity1.setCertCode(ioOrderDetailBizEntity.getCertCode());
ioOrderDetailBizEntity1.setSupId(ioOrderDetailBizEntity.getSupId());
ioOrderDetailBizEntity1.setBindSupStatus(ioOrderDetailBizEntity.getBindSupStatus());
ioOrderDetailBizEntity1.setCount(ioOrderDetailBizEntity.getCount());
ioOrderDetailBizEntities.add(ioOrderDetailBizEntity1);
}
}
//实际单据生成
IoOrderDetailResultEntity ioOrderDetailResultEntity1 = new IoOrderDetailResultEntity();
List<IoOrderDetailResultEntity> ioOrderDetailResultEntities = new ArrayList<>();
if (ioOrderDetailResultEntityList != null && ioOrderDetailResultEntityList.size() > 0) {
for (IoOrderDetailResultEntity ioOrderDetailResultEntity : ioOrderDetailResultEntityList) {
ioOrderDetailResultEntity1.setOrderIdFk(billNO);
UdiRlSupEntity udiRlSupEntity = map.get(ioOrderDetailResultEntity.getBindRlFk());
if (udiRlSupEntity != null) {
ioOrderDetailResultEntity1.setBindRlFk(udiRlSupEntity.getId());
ioOrderDetailResultEntity1.setUuidFk(udiRlSupEntity.getUdiRlIdFk() + "");
} else {
ioOrderDetailResultEntity1.setBindRlFk(null);
ioOrderDetailResultEntity1.setUuidFk(null);
}
ioOrderDetailResultEntity1.setNameCode(ioOrderDetailResultEntity.getNameCode());
ioOrderDetailResultEntity1.setBatchNo(ioOrderDetailResultEntity.getBatchNo());
ioOrderDetailResultEntity1.setProductDate(ioOrderDetailResultEntity.getProductDate());
ioOrderDetailResultEntity1.setExpireDate(ioOrderDetailResultEntity.getExpireDate());
ioOrderDetailResultEntity1.setCoName(ioOrderDetailResultEntity.getCoName());
ioOrderDetailResultEntity1.setCertCode(ioOrderDetailResultEntity.getCertCode());
ioOrderDetailResultEntity1.setYlqxzcrbarmc(ioOrderDetailResultEntity.getYlqxzcrbarmc());
ioOrderDetailResultEntity1.setManufacturer(ioOrderDetailResultEntity.getManufacturer());
ioOrderDetailResultEntity1.setMeasname(ioOrderDetailResultEntity.getMeasname());
ioOrderDetailResultEntity1.setPrice(ioOrderDetailResultEntity.getPrice());
ioOrderDetailResultEntity1.setSpec(ioOrderDetailResultEntity.getSpec());
ioOrderDetailResultEntity1.setCertCode(ioOrderDetailResultEntity.getCertCode());
ioOrderDetailResultEntity1.setSupId(ioOrderDetailResultEntity.getSupId());
ioOrderDetailResultEntity1.setBindSupStatus(ioOrderDetailResultEntity.getBindSupStatus());
ioOrderDetailResultEntity1.setCount(ioOrderDetailResultEntity.getCount());
ioOrderDetailResultEntities.add(ioOrderDetailResultEntity1);
}
}
//发票生成
IoOrderInvoiceEntity ioOrderInvoiceEntity1 = new IoOrderInvoiceEntity();
List<IoOrderInvoiceEntity> ioOrderInvoiceEntities = new ArrayList<>();
if (ioOrderInvoiceEntityList != null && ioOrderInvoiceEntityList.size() > 0) {
for (IoOrderInvoiceEntity ioOrderInvoiceEntity : ioOrderInvoiceEntityList) {
ioOrderInvoiceEntity1.setOrderIdFk(billNO);
UdiRlSupEntity udiRlSupEntity = map.get(ioOrderInvoiceEntity.getBindRlFk());
if (udiRlSupEntity != null) {
ioOrderInvoiceEntity1.setBindRlFk(udiRlSupEntity.getId() + "");
} else {
ioOrderInvoiceEntity1.setBindRlFk(null);
}
ioOrderInvoiceEntity1.setBatchNo(ioOrderInvoiceEntity.getBatchNo());
ioOrderInvoiceEntity1.setProductDate(ioOrderInvoiceEntity.getProductDate());
ioOrderInvoiceEntity1.setExpireDate(ioOrderInvoiceEntity.getExpireDate());
ioOrderInvoiceEntity1.setMachineNo(ioOrderInvoiceEntity.getMachineNo());
ioOrderInvoiceEntity1.setInvoiceCode(ioOrderInvoiceEntity.getInvoiceCode());
ioOrderInvoiceEntity1.setInvoiceEncode(ioOrderInvoiceEntity.getInvoiceEncode());
ioOrderInvoiceEntity1.setInvoiceDate(ioOrderInvoiceEntity.getInvoiceDate());
ioOrderInvoiceEntity1.setPrice(ioOrderInvoiceEntity.getPrice());
ioOrderInvoiceEntity1.setUpdateTime(new Date());
ioOrderInvoiceEntity1.setCreateTime(new Date());
ioOrderInvoiceEntity1.setUpdateUser(authAdmins.getId() + "");
ioOrderInvoiceEntity1.setCreateUser(authAdmins.getId() + "");
ioOrderInvoiceEntity1.setLicenseUrl(ioOrderInvoiceEntity.getLicenseUrl());
ioOrderInvoiceEntities.add(ioOrderInvoiceEntity1);
}
}
//生成单据
IoOrderEntity ioOrderEntity1 = new IoOrderEntity();
ioOrderEntity1.setBillNo(billNO);
ioOrderEntity1.setMainAction(ioOrderEntity.getMainAction());
ioOrderEntity1.setAction(platformLinkRespons.getTargetAction());
ioOrderEntity1.setFromCorp(ioOrderEntity.getFromCorp());
ioOrderEntity1.setFromCorp(ioOrderEntity.getFromCorp());
ioOrderEntity1.setFromDeptCode(ioOrderEntity.getFromDeptCode());
ioOrderEntity1.setFromInvCode(ioOrderEntity.getFromInvCode());
ioOrderEntity1.setFromType(1);
if (!checkUdi) {
ioOrderEntity1.setStatus(1);
ioOrderEntity1.setDealStatus(1);
} else {
ioOrderEntity1.setStatus(3);
ioOrderEntity1.setDealStatus(1);
ioOrderEntity1.setRemark("产品错误!");
}
ioOrderEntity1.setCreateTime(new Date());
ioOrderEntity1.setCreateUser(authAdmins.getId() + "");
ioOrderEntity1.setUpdateUser(authAdmins.getId() + "");
ioOrderEntity1.setUpdateTime(new Date());
ioOrderEntity1.setCustomerId(platformLinkRespons.getUnitId());
ioOrderEntity1.setDeptCode(platformLinkRespons.getInvCode());
ioOrderEntity1.setInvCode(platformLinkRespons.getInvSubCode());
//结果插入
ioOrderService.insertOrder(ioOrderEntity1);
ioOrderDetailBizDao.insertIgnoreBatchs(ioOrderDetailBizEntities);
ioOrderDetailCodeDao.insertIgnoreBatchs(ioOrderDetailCodeEntities);
ioCodeTempDao.insertIgnoreBatchs(ioCodeTempEntities);
ioOrderDetailResultDao.insertIgnoreBatchs(ioOrderDetailResultEntities);
ioOrderInvoiceMapper.insertIgnoreBatchs(ioOrderInvoiceEntities);
return true;
}
}

@ -1,6 +1,6 @@
spring:
profiles:
active: dev
active: test
jmx:
enabled: false
servlet:

@ -171,6 +171,13 @@
WHERE parentCode = #{parentCode}
</select>
<select id="getByWarePId" resultType="com.glxp.api.entity.auth.InvWarehouseEntity">
select *
FROM auth_warehouse
WHERE parentId = #{parentId}
and spUse = 1
</select>
<delete id="deleteByParentCode" parameterType="Map">
DELETE

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.auth.WarehouseBussinessTypeDao">
<resultMap id="BaseResultMap" autoMapping="true" type="com.glxp.api.entity.auth.WarehouseBussinessTypeEntity">
<resultMap id="BaseResultMap" autoMapping="true" type="com.glxp.api.entity.auth.WarehouseBussinessTypeEntity">
<!--@mbg.generated-->
<!--@Table auth_warehouse_bustype-->
<!-- <id column="id" jdbcType="INTEGER" property="id"/>-->
<!-- <id column="id" jdbcType="INTEGER" property="id"/>-->
<result column="code" jdbcType="VARCHAR" property="code"/>
<result column="action" jdbcType="VARCHAR" property="action"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
@ -183,4 +183,12 @@
#{item}
</foreach>
</select>
<select id="filterActionList" resultType="com.glxp.api.entity.auth.WarehouseBussinessTypeEntity">
SELECT b1.action,
b1.`name`
FROM auth_warehouse_bustype a1
INNER JOIN basic_bussiness_type b1 ON a1.action = b1.action
where b1.spUse=1 and a1.code = #{code}
</select>
</mapper>

@ -272,6 +272,12 @@
where action = #{action}
</select>
<select id="selectAction" resultType="java.lang.String">
select *
from basic_bussiness_type
where action = #{action}
</select>
<select id="selectbyNotAction" parameterType="list"
resultType="com.glxp.api.entity.basic.BasicBussinessTypeEntity">
select *

@ -377,4 +377,25 @@
</if>
</where>
</select>
<select id="filterCompanyProduct" parameterType="com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest"
resultType="com.glxp.api.entity.basic.UdiRlSupEntity">
SELECT
basic_udirel.id,
basic_udirel.uuid as udiRlIdFk
FROM
company_product_relevance
INNER JOIN basic_udirel ON company_product_relevance.udiRlIdFk = basic_udirel.id
INNER JOIN basic_products ON basic_udirel.uuid = basic_products.uuid
LEFT JOIN basic_corp ON basic_corp.erpId = company_product_relevance.customerId
<where>
<if test="customerId != '' and customerId != null">
and company_product_relevance.customerId = #{customerId}
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode}, '%')
</if>
</where>
ORDER BY id DESC
</select>
</mapper>

Loading…
Cancel
Save