采购订单,单据流转等修改

pro
anthonywj 2 years ago
parent d458e72c7e
commit 0083117df9

@ -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);
}

@ -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 ->
{

@ -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:

@ -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