This commit is contained in:
cb 2025-05-23 18:06:54 +08:00
parent 71bb414f23
commit cc032f44c0
8 changed files with 35 additions and 8 deletions

View File

@ -473,16 +473,18 @@ public class OrderDetailController extends BaseController {
param1.setFinancialChangeRecordId(financialChangeRecord.getId()); param1.setFinancialChangeRecordId(financialChangeRecord.getId());
BigDecimal attachmentMoney= BigDecimal.ZERO; BigDecimal attachmentMoney= BigDecimal.ZERO;
List<OrderAttachmentRecord> orderAttachmentRecords=orderAttachmentRecordService.selectOrderAttachmentRecordList(param1); List<OrderAttachmentRecord> orderAttachmentRecords=orderAttachmentRecordService.selectOrderAttachmentRecordList(param1);
logger.info("参数传递{},配件的金额查询为{}",orderAttachmentRecords,param1);
if(orderAttachmentRecords!=null&&orderAttachmentRecords.size()>0){ if(orderAttachmentRecords!=null&&orderAttachmentRecords.size()>0){
attachmentMoney.add(orderAttachmentRecords.get(0).getAttachMoney()); attachmentMoney= attachmentMoney.add(orderAttachmentRecords.get(0).getAttachMoney());
financialChangeRecord.setAttachmentMoney(attachmentMoney); financialChangeRecord.setAttachmentMoney(attachmentMoney);
logger.info("配件的金为{}",attachmentMoney);
} }
} }
for (OrderAttachmentRecord orderAttachmentRecord:orderAttachmentRecordList){ for (OrderAttachmentRecord orderAttachmentRecord:orderAttachmentRecordList){
addMoneyTotal= addMoneyTotal.add(orderAttachmentRecord.getAttachMoney()); addMoneyTotal= addMoneyTotal.add(orderAttachmentRecord.getAttachMoney());
} }
logger.info("加价的金额总额为{}",addMoneyTotal); logger.info("所有的加价订单{}",financialChangeRecords);
// 编辑返回属性 // 编辑返回属性
orderListResponse.setAddMoneyRemark(addMoneyRemark); orderListResponse.setAddMoneyRemark(addMoneyRemark);
@ -1343,7 +1345,7 @@ public class OrderDetailController extends BaseController {
public AjaxResult changePrice(@Valid @RequestBody OrderChangePriceRequest request) { public AjaxResult changePrice(@Valid @RequestBody OrderChangePriceRequest request) {
try { try {
Assert.notNull(request.getChangeMoney(), "报价不能为空"); Assert.notNull(request.getChangeMoney(), "报价不能为空");
return toAjax(orderDetailService.changePrice(request.getOrderDetailId(), request.getChangeMoney(), request.getType(), request.getRemark(),request.getUrls(),request.getFileNames())); return toAjax(orderDetailService.changePrice(request.getOrderDetailId(), request.getChangeMoney(), request.getType(), request.getRemark(),request.getUrls(),request.getFileNames(),request.getReason()));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
logger.error(ExceptionUtil.getExceptionMessage(e)); logger.error(ExceptionUtil.getExceptionMessage(e));

View File

@ -1196,6 +1196,18 @@ public class OrderMasterController extends BaseController {
if (StringUtils.isNotEmpty(financialChangeRecord.getRemark())){ if (StringUtils.isNotEmpty(financialChangeRecord.getRemark())){
remark= financialChangeRecord.getRemark(); remark= financialChangeRecord.getRemark();
} }
OrderAttachmentRecord param1 = new OrderAttachmentRecord();
param1.setFinancialChangeRecordId(financialChangeRecord.getId());
BigDecimal attachmentMoney= BigDecimal.ZERO;
List<OrderAttachmentRecord> orderAttachmentRecords=orderAttachmentRecordService.selectOrderAttachmentRecordList(param1);
logger.info("参数传递{},配件的金额查询为{}",orderAttachmentRecords,param1);
if(orderAttachmentRecords!=null&&orderAttachmentRecords.size()>0){
logger.info("参数传递{},配件的金额查询为{}",param1,orderAttachmentRecords.get(0));
logger.info("配件金额为{}",orderAttachmentRecords.get(0).getAttachMoney());
attachmentMoney= attachmentMoney.add(orderAttachmentRecords.get(0).getAttachMoney());
financialChangeRecord.setAttachmentMoney(attachmentMoney);
logger.info("配件的金为{}",attachmentMoney);
}
} }
for (OrderAttachmentRecord orderAttachmentRecord:orderAttachmentRecordList){ for (OrderAttachmentRecord orderAttachmentRecord:orderAttachmentRecordList){
addMoneyTotal= addMoneyTotal.add(orderAttachmentRecord.getAttachMoney()); addMoneyTotal= addMoneyTotal.add(orderAttachmentRecord.getAttachMoney());

View File

@ -8,6 +8,7 @@ import java.math.BigDecimal;
/** /**
* 改价请求实体 * 改价请求实体
*
* @author clunt * @author clunt
*/ */
@Data @Data
@ -25,4 +26,6 @@ public class OrderChangePriceRequest implements Serializable {
private String urls; private String urls;
private String fileNames; private String fileNames;
private String reason;
} }

View File

@ -130,7 +130,7 @@ public interface OrderDetailService {
* @param remark 备注 * @param remark 备注
* @return 成功/失败 * @return 成功/失败
*/ */
int changePrice(Long orderDetailId, BigDecimal changeMoney, Integer type, String remark,String urls ,String fileNames) throws Exception; int changePrice(Long orderDetailId, BigDecimal changeMoney, Integer type, String remark,String urls ,String fileNames,String reason) throws Exception;
int sureChange(Long financialChangeRecordId); int sureChange(Long financialChangeRecordId);

View File

@ -1026,13 +1026,12 @@ public class OrderDetailServiceImpl implements OrderDetailService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public int changePrice(Long orderDetailId, BigDecimal changeMoney, Integer type, String remark,String urls ,String fileNames) throws public int changePrice(Long orderDetailId, BigDecimal changeMoney, Integer type, String remark,String urls ,String fileNames,String reason) throws
Exception { Exception {
OrderDetail orderDetail = orderDetailMapper.selectById(orderDetailId); OrderDetail orderDetail = orderDetailMapper.selectById(orderDetailId);
if (orderDetail == null) { if (orderDetail == null) {
throw new BaseException("子单不存在!"); throw new BaseException("子单不存在!");
} }
logger.info("改价或者加价订单id{}金额{}",orderDetailId,changeMoney);
// 主单 // 主单
OrderMaster orderMaster = orderMasterService.selectById(orderDetail.getOrderMasterId()); OrderMaster orderMaster = orderMasterService.selectById(orderDetail.getOrderMasterId());
// 主师傅 // 主师傅
@ -1068,6 +1067,9 @@ public class OrderDetailServiceImpl implements OrderDetailService {
financialChangeRecord.setChangeMoney(changeMoney); financialChangeRecord.setChangeMoney(changeMoney);
financialChangeRecord.setType(type); financialChangeRecord.setType(type);
financialChangeRecord.setRemark(remark); financialChangeRecord.setRemark(remark);
financialChangeRecord.setUrls(urls);
financialChangeRecord.setFileNames(fileNames);
financialChangeRecord.setReason(reason);
this.buildSettle(financialChangeRecord, deptGoodsCategory, workerMaster); this.buildSettle(financialChangeRecord, deptGoodsCategory, workerMaster);
affectedRows = financialChangeRecordService.update(financialChangeRecord); affectedRows = financialChangeRecordService.update(financialChangeRecord);
} else { } else {
@ -1082,6 +1084,7 @@ public class OrderDetailServiceImpl implements OrderDetailService {
financialChangeRecord.setRemark(remark); financialChangeRecord.setRemark(remark);
financialChangeRecord.setUrls(urls); financialChangeRecord.setUrls(urls);
financialChangeRecord.setFileNames(fileNames); financialChangeRecord.setFileNames(fileNames);
financialChangeRecord.setReason(reason);
this.buildSettle(financialChangeRecord, deptGoodsCategory, workerMaster); this.buildSettle(financialChangeRecord, deptGoodsCategory, workerMaster);
affectedRows = financialChangeRecordService.insert(financialChangeRecord); affectedRows = financialChangeRecordService.insert(financialChangeRecord);
} }

View File

@ -48,7 +48,7 @@
<if test="orderMasterId != null">#{orderMasterId},</if> <if test="orderMasterId != null">#{orderMasterId},</if>
<if test="type != null">#{type},</if> <if test="type != null">#{type},</if>
<if test="attachMoney != null">#{attachMoney},</if> <if test="attachMoney != null">#{attachMoney},</if>
<if test="financialChangeRecordId != null">#{financial_change_record_id},</if> <if test="financialChangeRecordId != null">#{financialChangeRecordId},</if>
</trim> </trim>
</insert> </insert>

View File

@ -96,4 +96,6 @@ public class FinancialChangeRecord extends BaseEntity {
private String fileNames; private String fileNames;
private BigDecimal attachmentMoney; private BigDecimal attachmentMoney;
private String reason;
} }

View File

@ -23,11 +23,12 @@
<result property="leftMoney" column="left_money"/> <result property="leftMoney" column="left_money"/>
<result property="urls" column="urls"/> <result property="urls" column="urls"/>
<result property="fileNames" column="file_name"/> <result property="fileNames" column="file_name"/>
<result property="reason" column="reason"/>
</resultMap> </resultMap>
<sql id="selectFinancialChangeRecordVo"> <sql id="selectFinancialChangeRecordVo">
SELECT id, order_detail_id, order_master_id, payment_id, reverse_id, SELECT id, order_detail_id, order_master_id, payment_id, reverse_id,
change_money, status, pay_status, type, left_money, remark,urls ,file_names FROM financial_change_record change_money, status, pay_status, type, left_money, remark,urls ,file_names,reason FROM financial_change_record
</sql> </sql>
<select id="selectNotPayRecordByDetailId" parameterType="Long" resultMap="FinancialChangeRecordResult"> <select id="selectNotPayRecordByDetailId" parameterType="Long" resultMap="FinancialChangeRecordResult">
@ -82,6 +83,7 @@
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="urls != null">urls,</if> <if test="urls != null">urls,</if>
<if test="fileNames != null">file_names,</if> <if test="fileNames != null">file_names,</if>
<if test="reason != null">reason,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderDetailId != null">#{orderDetailId},</if> <if test="orderDetailId != null">#{orderDetailId},</if>
@ -102,6 +104,7 @@
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="urls != null">#{urls},</if> <if test="urls != null">#{urls},</if>
<if test="fileNames != null">#{fileNames},</if> <if test="fileNames != null">#{fileNames},</if>
<if test="reason != null">#{reason},</if>
</trim> </trim>
</insert> </insert>
@ -125,6 +128,8 @@
<if test="type != null">type = #{type},</if> <if test="type != null">type = #{type},</if>
<if test="leftMoney != null">left_money = #{leftMoney},</if> <if test="leftMoney != null">left_money = #{leftMoney},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="urls != null">urls = #{urls},</if>
<if test="reason != null">reason = #{reason},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>