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

pro
anthonywj 2 years ago
parent d458e72c7e
commit 0083117df9

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

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

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

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

@ -257,6 +257,17 @@ public class IoChangeInoutService {
codeTempEntities.add(codeTempEntity); codeTempEntities.add(codeTempEntity);
} }
codeTempService.insertBatch(codeTempEntities); 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) { if (isGenInovice) {
//生成发票信息 //生成发票信息
List<IoOrderInvoiceEntity> invoiceEntities = ioOrderInvoiceService.findByBillNo(orderEntity.getBillNo()); List<IoOrderInvoiceEntity> invoiceEntities = ioOrderInvoiceService.findByBillNo(orderEntity.getBillNo());

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

@ -3,7 +3,7 @@ server:
spring: spring:
datasource: datasource:
driver-class-name: com.p6spy.engine.spy.P6SpyDriver 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 username: root
password: 123456 password: 123456
hikari: hikari:

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

Loading…
Cancel
Save