Merge branch 'dev' into test

pro
wj 2 years ago
commit 493a30dd5d

@ -27,10 +27,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@ -308,4 +305,44 @@ public class LoginController extends BaseController {
return ResultVOUtils.error(ResultEnum.DATA_CHANGE);
}
/**
*
*
* @return
*/
@ResponseBody
@PostMapping(value = "/verify")
public BaseResponse verify(@RequestBody Map<String, Object> params,
HttpServletRequest request) {
AuthAdmin authAdmin;
authAdmin = authAdminService.findByUserName(params.get("username").toString());
if (authAdmin == null) {
throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误");
}
if (!PasswordUtils.authAdminPwd(params.get("password").toString()).equals(authAdmin.getPassWord())) {
throw new JsonException(ResultEnum.DATA_NOT, "用户名或密码错误");
}
AuthLicense authLicense = new AuthLicense();
if (params.get("appid") != null) {
authLicense = authLicenseDao.get(params.get("appid").toString());
} else {
String appid = AppUtils.getAppid();
authLicense.setId(appid);
authLicense.setAppid(appid);
authLicense.setApiKey(appid);
if (params.get("name") != null)
authLicense.setName(params.get("name").toString());
authLicense.setSecretKey(AppUtils.getSecretKey(appid));
authLicense.setCustomerId(authAdmin.getCustomerId() + "");
CompanyEntity companyEntity = companyService.findCompany(authAdmin.getCustomerId());
authLicense.setCompanyName(companyEntity.getCompanyName());
authLicense.setCreateDate(new Date());
authLicenseDao.romveByCustomerId(authAdmin.getCustomerId() + "");
authLicenseDao.save(authLicense);
}
return ResultVOUtils.success(authLicense);
}
}

@ -614,8 +614,8 @@ public class IoOrderDetailBizController extends BaseController {
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);
}
ioOrderDetailBizEntity.setCheckFileName(ioOrderDetailBizEntity.getFilePath());
ioOrderDetailBizEntity.setCheckColdFileName(ioOrderDetailBizEntity.getColdFilePath());
ioOrderDetailBizEntity.setCheckFileName(ioOrderDetailBizEntity.getCheckFileName());
ioOrderDetailBizEntity.setCheckColdFileName(ioOrderDetailBizEntity.getCheckColdFileName());
boolean b = orderDetailBizService.updateOrderDetailBiz(ioOrderDetailBizEntity);
return ResultVOUtils.success("修改成功!");
}

@ -147,16 +147,16 @@ public class InvProductController extends BaseController {
}
//根据单据日期排序
list.sort((o1, o2) -> {
long o1OrderTime = DateUtil.parseDate(o1.getOrderTime()).getTime();
long o2OrderTime = DateUtil.parseDate(o2.getOrderTime()).getTime();
if (o1OrderTime > o2OrderTime) {
return 1;
} else if (o1OrderTime < o2OrderTime) {
return -1;
}
return 0;
});
// list.sort((o1, o2) -> {
// long o1OrderTime = DateUtil.parseDate(o1.getOrderTime()).getTime();
// long o2OrderTime = DateUtil.parseDate(o2.getOrderTime()).getTime();
// if (o1OrderTime > o2OrderTime) {
// return 1;
// } else if (o1OrderTime < o2OrderTime) {
// return -1;
// }
// return 0;
// });
PageSimpleResponse<InvProductDetailResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());

@ -204,11 +204,12 @@ public class PurOrderController {
ioOrderDetailBizEntity.setCertCode(basicProductsEntity.getZczbhhzbapzbh());
ioOrderDetailBizEntity.setYlqxzcrbarmc(basicProductsEntity.getYlqxzcrbarmc());
ioOrderDetailBizEntity.setManufacturer(basicProductsEntity.getManufactory());
ioOrderDetailBizEntity.setPrice(obj.getPrice());
ioOrderDetailBizEntity.setMeasname(basicProductsEntity.getMeasname());
ioOrderDetailBizEntity.setSpec(basicProductsEntity.getGgxh());
if (basicProductsEntity.getPrice() != null) {
ioOrderDetailBizEntity.setPrice(BigDecimal.valueOf(basicProductsEntity.getPrice()));
}
// if (basicProductsEntity.getPrice() != null) {
// ioOrderDetailBizEntity.setPrice(BigDecimal.valueOf(basicProductsEntity.getPrice()));
// }
ioOrderDetailBizEntity.setSupId(obj.getSupId());
ioOrderDetailBizService.insert(ioOrderDetailBizEntity);
}
@ -299,11 +300,6 @@ public class PurOrderController {
}
public void genOrder() {
}
/**
*
*/

@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.math.BigDecimal;
@Data
@TableName(value = "pur_order_detail")
public class PurOrderDetailEntity {
@ -48,6 +50,10 @@ public class PurOrderDetailEntity {
@TableField(value = "zczbhhzbapzbh")
private String zczbhhzbapzbh;
@TableField(value = "price")
private BigDecimal price;
public static final String COL_ID = "id";
public static final String COL_ORDERIDFK = "orderIdFk";

@ -241,7 +241,6 @@ public class IoOrderResponse {
private BigDecimal allAmount;
/**
*
*/
@ -256,10 +255,11 @@ public class IoOrderResponse {
public String getFromName() {
if (StrUtil.isNotEmpty(fromCorpName))
return fromCorpName;
if (StrUtil.isNotEmpty(fromInvName))
return fromInvName;
if (StrUtil.isNotEmpty(fromCorpName))
return fromCorpName;
return fromName;
}
}

@ -48,4 +48,7 @@ public class PurOrderDetailResponse {
private String supId;
private String supName;
private String billNo;
private String nameCode;
}

@ -257,6 +257,17 @@ public class IoChangeInoutService {
codeTempEntities.add(codeTempEntity);
}
codeTempService.insertBatch(codeTempEntities);
// 生成业务单
List<IoOrderDetailBizEntity> orderDetailBizEntities = orderDetailBizService.findByOrderId(orderEntity.getBillNo());
if (CollUtil.isNotEmpty(orderDetailBizEntities)) {
for (IoOrderDetailBizEntity orderDetailBizEntity : orderDetailBizEntities) {
orderDetailBizEntity.setOrderIdFk(outOrder.getBillNo());
orderDetailBizEntity.setId(IdUtil.getSnowflakeNextId());
orderDetailBizService.insert(orderDetailBizEntity);
}
}
if (isGenInovice) {
//生成发票信息
List<IoOrderInvoiceEntity> invoiceEntities = ioOrderInvoiceService.findByBillNo(orderEntity.getBillNo());

@ -290,8 +290,10 @@ public class IoCheckInoutService {
orderService.update(orderEntity);
return;
}
orderDetailBizService.deleteByOrderId(orderEntity.getBillNo());
if (orderEntity.getFromType() != ConstantStatus.FROM_COPY
&& orderEntity.getFromType() != ConstantStatus.FROM_CHANGE) {
orderDetailBizService.deleteByOrderId(orderEntity.getBillNo());
}
orderDetailResultService.deleteByOrderId(orderEntity.getBillNo());
orderDetailCodeEntities.forEach(orderDetailCodeEntity ->
{

@ -382,7 +382,7 @@ public class SpsSyncDownloadService {
Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.SUP_CERT, createFile);
totalTimeMap.put(BasicExportStatusTimeEnum.SUP_CERT, map);
List<SupCertEntity> supCertList = supCertService.list(Wrappers.lambdaQuery(SupCertEntity.class)
.eq(SupCertEntity::getAuditStatus, ConstantStatus.AUDIT_PASS)
.ge(SupCertEntity::getAuditStatus, ConstantStatus.AUDIT_PASS)
.le(!ge && (boolean) map.get("isNew"), SupCertEntity::getUpdateTime, now)
.between(ge, SupCertEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), SupCertEntity::getUpdateTime
@ -392,7 +392,8 @@ public class SpsSyncDownloadService {
jsonMap.put(SupCertEntity.class.getSimpleName(), supCertList);
for (SupCertEntity supCertEntity : supCertList) {
if (StrUtil.isNotEmpty(supCertEntity.getFilePath())) {
syncFiles.add(supCertEntity.getFilePath());
String[] fileNames = supCertEntity.getFilePath().split(",");
syncFiles.addAll(CollUtil.toList(fileNames));
}
}
if (CollUtil.isNotEmpty(syncFiles)) {
@ -410,7 +411,7 @@ public class SpsSyncDownloadService {
jsonMap.put(SupCertSetEntity.class.getSimpleName(), supCertSetList);
}
List<SupCompanyEntity> supCompanyList = supCompanyService.list(Wrappers.lambdaQuery(SupCompanyEntity.class)
.eq(SupCompanyEntity::getAuditStatus, ConstantStatus.AUDIT_PASS)
.ge(SupCompanyEntity::getAuditStatus, ConstantStatus.AUDIT_PASS)
.le(!ge && (boolean) map.get("isNew"), SupCompanyEntity::getUpdateTime, now)
.between(ge, SupCompanyEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), SupCompanyEntity::getUpdateTime
@ -421,7 +422,7 @@ public class SpsSyncDownloadService {
jsonMap.put(SupCompanyEntity.class.getSimpleName(), supCompanyList);
}
List<SupManufacturerEntity> supManufacturerList = supManufacturerService.list(Wrappers.lambdaQuery(SupManufacturerEntity.class)
.eq(SupManufacturerEntity::getAuditStatus, ConstantStatus.AUDIT_PASS)
.ge(SupManufacturerEntity::getAuditStatus, ConstantStatus.AUDIT_PASS)
.le(!ge && (boolean) map.get("isNew"), SupManufacturerEntity::getUpdateTime, now)
.between(ge, SupManufacturerEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), SupManufacturerEntity::getUpdateTime
@ -432,7 +433,7 @@ public class SpsSyncDownloadService {
jsonMap.put(SupManufacturerEntity.class.getSimpleName(), supManufacturerList);
}
List<SupProductEntity> supProductList = supProductService.list(Wrappers.lambdaQuery(SupProductEntity.class)
.eq(SupProductEntity::getAuditStatus, ConstantStatus.AUDIT_PASS)
.ge(SupProductEntity::getAuditStatus, ConstantStatus.AUDIT_PASS)
.le(!ge && (boolean) map.get("isNew"), SupProductEntity::getUpdateTime, now)
.between(ge, SupProductEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), SupProductEntity::getUpdateTime
@ -876,8 +877,13 @@ public class SpsSyncDownloadService {
if (CollUtil.isNotEmpty(bizEntities)) {
orderDetailBizEntities.addAll(bizEntities);
for (IoOrderDetailBizEntity bizEntity : bizEntities) {
if (StrUtil.isNotEmpty(bizEntity.getCheckFileName())) {
syncFiles.add(bizEntity.getCheckFileName());
if (StrUtil.isNotEmpty(bizEntity.getFilePath())) {
String[] fileNames = bizEntity.getFilePath().split(",");
syncFiles.addAll(CollUtil.toList(fileNames));
}
if (StrUtil.isNotEmpty(bizEntity.getColdFilePath())) {
String[] fileNames = bizEntity.getColdFilePath().split(",");
syncFiles.addAll(CollUtil.toList(fileNames));
}
}
}

@ -0,0 +1,63 @@
package com.glxp.api.util;
import lombok.extern.slf4j.Slf4j;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.UUID;
@Slf4j
public class AppUtils {
//生成secret_key
private final static String SALT = "1qazxsw2";
private static final String ALGORITH_NAME = "sha-512";
private static final int HASH_ITERATIONS = 2;
private final static String[] CHARS = new String[]{"a", "b", "c", "d", "e", "f",
"g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s",
"t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5",
"6", "7", "8", "9", "a", "b", "c", "d", "e", "f",
"g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s",
"t", "u", "v", "w", "x", "y", "z"};
public static String getAppid() {
StringBuffer shortBuffer = new StringBuffer();
String uuid = UUID.randomUUID().toString().replace("-", "");
for (int i = 0; i < 8; i++) {
String str = uuid.substring(i * 4, i * 4 + 4);
int x = Integer.parseInt(str, 16);
shortBuffer.append(CHARS[x % 0x3E]);
}
return shortBuffer.toString();
}
public static String getSecretKey(String appid) {
try {
String[] array = new String[]{appid, SALT};
StringBuilder sb = new StringBuilder();
Arrays.sort(array);
for (String s : array) {
sb.append(s);
}
String str = sb.toString();
MessageDigest md = MessageDigest.getInstance("SHA-1");
md.update(str.getBytes());
byte[] digest = md.digest();
StringBuilder hexstr = new StringBuilder();
String shaHex = "";
for (byte b : digest) {
shaHex = Integer.toHexString(b & 0xFF);
if (shaHex.length() < 2) {
hexstr.append(0);
}
hexstr.append(shaHex);
}
return hexstr.toString();
} catch (NoSuchAlgorithmException e) {
log.error(e.getMessage(), e);
throw new RuntimeException();
}
}
}

@ -3,7 +3,7 @@ server:
spring:
datasource:
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_spms_pt?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_spms?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: 123456
hikari:

@ -73,7 +73,7 @@
thrCheckPdaUn, thrCheckPdaEd, thrCheckUdims, thrCheckPc, thrCheckSp,
thrCheckChange, thrCheckBalance, thrCheckCopy, fillCodeRel, checkVailDate,
checkExpire, checkCertExpire, preInBackAction, backPreinType, checkPreInOrders,
sortNum,spaceOut)
sortNum, spaceOut)
values (#{mainAction}, #{action}, #{name}, #{enable}, #{remark}, #{thirdSysFk}, #{genUnit}, #{innerOrder},
#{secCheckEnable}, #{checkEnable}, #{checkUdims}, #{checkPdaEd}, #{checkPdaUn}, #{checkPc},
#{checkWebNew}, #{checkSp}, #{checkChange}, #{secCheckUdims}, #{secCheckPdaEd}, #{secCheckPdaUn},
@ -86,7 +86,7 @@
#{thrCheckPdaUn}, #{thrCheckPdaEd}, #{thrCheckUdims}, #{thrCheckPc}, #{thrCheckSp},
#{thrCheckChange}, #{thrCheckBalance}, #{thrCheckCopy}, #{fillCodeRel}, #{checkVailDate},
#{checkExpire}, #{checkCertExpire}, #{preInBackAction}, #{backPreinType}, #{checkPreInOrders},
#{sortNum},#{spaceOut})
#{sortNum}, #{spaceOut})
</insert>
<select id="selectBusList" resultType="com.glxp.api.entity.basic.BasicBussinessTypeEntity">
@ -260,7 +260,7 @@
AND auth_warehouse_bustype.code = #{code}
</if>
<if test="invCode != ''and invCode != null">
AND auth_warehouse_bustype.code = #{code}
AND auth_warehouse_bustype.code = #{invCode}
</if>
</where>
group by basic_bussiness_type.action

@ -38,11 +38,12 @@
<select id="joinQueryList" parameterType="com.glxp.api.req.purchase.PurOrderDetailRequest"
resultType="com.glxp.api.res.purchase.PurOrderDetailResponse">
SELECT pur_order_detail.*,
basic_products.ggxh spec,
basic_products.ggxh spec,
basic_products.nameCode nameCode,
basic_products.measname,
basic_products.manufactory,
basic_products.ylqxzcrbarmc,
basic_corp.`name` supName
basic_corp.`name` supName
FROM pur_order_detail
left JOIN basic_udirel ON pur_order_detail.productId = basic_udirel.id
left JOIN basic_products ON basic_udirel.uuid = basic_products.uuid
@ -98,6 +99,9 @@
<if test="zczbhhzbapzbh != null">
zczbhhzbapzbh=#{zczbhhzbapzbh},
</if>
<if test="price != null">
price=#{price},
</if>
</trim>
WHERE id = #{id}
</update>
@ -106,7 +110,7 @@
<insert id="insertPurOrderDetailEntity" keyProperty="id"
parameterType="com.glxp.api.entity.purchase.PurOrderDetailEntity">
REPLACE INTO pur_order_detail
(orderIdFk, productId, productName, count, supId, zczbhhzbapzbh) values
(orderIdFk, productId, productName, count, supId, zczbhhzbapzbh, price) values
<foreach collection="datas" item="item" index="index" separator=",">
(#{item.orderIdFk},
@ -114,7 +118,7 @@
#{item.productName},
#{item.count},
#{item.supId},
#{item.zczbhhzbapzbh})
#{item.zczbhhzbapzbh}, #{item.price})
</foreach>
</insert>

@ -383,6 +383,8 @@ CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'id', 'bigint ', 2);
CALL Pro_Temp_ColumnWork('io_order_invoice', 'bizIdFk', 'bigint ', 2);
CALL Pro_Temp_ColumnWork('pur_order_detail', 'price', 'decimal(10, 2)', 1);

Loading…
Cancel
Save