12.6修改

This commit is contained in:
赵辉
2025-12-06 20:31:05 +08:00
parent a950417939
commit 0b361ba2b7
9 changed files with 134 additions and 70 deletions
@@ -113,6 +113,8 @@ public class TmsReceiptApplicationService {
tmsReceiptDO.setOrganizationId(organizationId);
tmsReceiptDO.setOrganizationName(organizationName);
tmsReceiptDO.setCreateBy(userId);
tmsReceiptDO.setAccountName(dto.getAccountName());
tmsReceiptDO.setAccountInformation(dto.getAccountInformation());
tmsReceiptDO.setCreateByName(userName);
tmsReceiptDO.setReceivePaymentNumber(OrderSequence.getOrderCode());
tmsReceiptDO.setCreateTime(now);
@@ -92,6 +92,14 @@ public class TmsReceipt extends BaseVOEntity{
@Excel(name = "收款备注")
private String remark;
@ApiModelProperty("账户名称")
@Excel(name = "账户名称")
private String accountName;
@ApiModelProperty("账户信息")
@Excel(name = "账户信息")
private String accountInformation;
@ApiModelProperty("删除标记:0-无状态,1-正常,2-已删除")
@Excel(name = "是否删除", readConverterExp = "删除标记:0-无状态,1-正常,2-已删除")
private Integer delFlag;
@@ -88,6 +88,14 @@ public class TmsReceiptPO extends BaseVOEntity{
@Excel(name = "收款备注")
private String remark;
@ApiModelProperty("账户名称")
@Excel(name = "账户名称")
private String accountName;
@ApiModelProperty("账户信息")
@Excel(name = "账户信息")
private String accountInformation;
@ApiModelProperty("删除标记:0-无状态,1-正常,2-已删除")
@Excel(name = "是否删除", readConverterExp = "删除标记:0-无状态,1-正常,2-已删除")
private Integer delFlag;
@@ -99,6 +99,14 @@ public class TmsReceiptDO extends BaseVOEntity{
@Excel(name = "收款备注")
private String remark;
@ApiModelProperty("账户名称")
@Excel(name = "账户名称")
private String accountName;
@ApiModelProperty("账户信息")
@Excel(name = "账户信息")
private String accountInformation;
@ApiModelProperty("删除标记:0-无状态,1-正常,2-已删除")
@Excel(name = "是否删除", readConverterExp = "删除标记:0-无状态,1-正常,2-已删除")
private Integer delFlag;
@@ -95,6 +95,14 @@ public class TmsReceiptDTO extends BaseVOEntity{
@Excel(name = "收款备注")
private String remark;
@ApiModelProperty("账户名称")
@Excel(name = "账户名称")
private String accountName;
@ApiModelProperty("账户信息")
@Excel(name = "账户信息")
private String accountInformation;
@ApiModelProperty("删除标记:0-无状态,1-正常,2-已删除")
@Excel(name = "是否删除", readConverterExp = "删除标记:0-无状态,1-正常,2-已删除")
private Integer delFlag;
@@ -1,11 +1,16 @@
package com.linke.finance.interfaces.facadeApp.tmsReceipt;
import java.util.ArrayList;
import java.util.List;
import com.linke.finance.application.server.receivingAccount.ReceivingAccountApplicationService;
import com.linke.finance.application.server.tmsReceipt.TmsReceiptApplicationService;
import com.linke.finance.application.server.tmsReceipt.TmsReceiptAssembler;
import com.linke.finance.domain.receivingAccount.repository.po.ReceivingAccountPO;
import com.linke.finance.domain.receivingAccount.repository.todo.ReceivingAccountDO;
import com.linke.finance.domain.tmsReceipt.repository.po.TmsReceiptPO;
import com.linke.finance.domain.tmsReceipt.repository.todo.TmsReceiptDO;
import com.linke.finance.interfaces.dto.ReceivingAccountDTO;
import com.linke.finance.interfaces.dto.TmsReceiptDTO;
import com.mhd.common.core.utils.IgnoreNullUtil;
import com.mhd.common.core.utils.bean.BeanUtils;
@@ -33,6 +38,8 @@ public class TmsReceiptApi extends BaseController{
@Autowired
private TmsReceiptApplicationService tmsReceiptApplicationService;
@Autowired
private ReceivingAccountApplicationService receivingAccountApplicationService;
@Resource
private TmsReceiptAssembler tmsReceiptAssembler;
@@ -53,6 +60,66 @@ public class TmsReceiptApi extends BaseController{
List<TmsReceiptPO> list = tmsReceiptApplicationService.queryList(tmsReceiptDO);
return getDataTable(list);
}
/**
* 查询收款账户列表
*/
// @ApiOperation("查询收款账户列表")
@Log(title = "查询收款账户列表", description = "查询收款账户列表", businessType = BusinessType.INQUIRE)
@GetMapping("/listAccount")
public TableDataInfo listAccount(ReceivingAccountDTO receivingAccountDTO)
{
//转换实体
ReceivingAccountDO receivingAccountDO = new ReceivingAccountDO();
BeanUtils.copyProperties(receivingAccountDTO, receivingAccountDO);
startPage();
List<ReceivingAccountPO> list = receivingAccountApplicationService.queryList(receivingAccountDO);
return getDataTable(list);
}
/**
* 新增收款账户
*/
// @ApiOperation("新增收款账户")
@Log(title = "新增收款账户", description = "新增收款账户", businessType = BusinessType.INSERT)
@PostMapping("/addAccount")
public AjaxResult addAccount(@RequestBody ReceivingAccountDTO receivingAccountDTO)
{
//转换实体
ReceivingAccountDO receivingAccountDO = new ReceivingAccountDO();
BeanUtils.copyProperties(receivingAccountDTO, receivingAccountDO);
return toAjax(receivingAccountApplicationService.insert(receivingAccountDO));
}
/**
* 批量新增收款账户
*/
// @ApiOperation("批量新增收款账户")
@Log(title = "批量新增收款账户", description = "批量新增收款账户", businessType = BusinessType.INSERT)
@PostMapping("/batchAddAccount")
public AjaxResult batchAddAccount(@RequestBody List<ReceivingAccountDTO> receivingAccountDTOList)
{
//转换实体
List<ReceivingAccountDO> receivingAccountDOList = new ArrayList<>();
for (ReceivingAccountDTO dto : receivingAccountDTOList) {
ReceivingAccountDO receivingAccountDO = new ReceivingAccountDO();
BeanUtils.copyProperties(dto, receivingAccountDO);
receivingAccountDOList.add(receivingAccountDO);
}
return toAjax(receivingAccountApplicationService.batchInsert(receivingAccountDOList));
}
/**
* 删除收款账户
*/
// @ApiOperation("删除收款账户")
@Log(title = "删除收款账户", description = "删除收款账户", businessType = BusinessType.DELETE)
@DeleteMapping("/deleteAccount/{id}")
public AjaxResult deleteAccount(@PathVariable("id") Long id)
{
return toAjax(receivingAccountApplicationService.deleteById(id));
}
/**
* 编辑&保存收款单
@@ -24,6 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="creditReason" column="credit_reason" />
<result property="serialNumber" column="serial_number" />
<result property="remark" column="remark" />
<result property="accountName" column="account_name" />
<result property="accountInformation" column="account_information" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
@@ -35,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectTmsReceiptPo">
select id, top_organization_id,organization_id,organization_name,department_name,settlement_party_name,receive_payment_number, receive_payment_amount,
assignable_amount,assignment_status,credit_amount,credit_reason, receive_payment_time, serial_number,receive_voucher_url,
remark, create_by,create_by_name, create_time, update_by,update_by_name, update_time, del_flag from tms_receipt
remark, account_name, account_information, create_by,create_by_name, create_time, update_by,update_by_name, update_time, del_flag from tms_receipt
</sql>
<sql id="selectTmsReceiptPo1">
@@ -89,6 +91,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
<if test="remark != null and remark != ''">
and remark = #{remark}
</if>
<if test="accountName != null and accountName != ''">
and account_name like concat('%', #{accountName}, '%')
</if>
<if test="accountInformation != null and accountInformation != ''">
and account_information like concat('%', #{accountInformation}, '%')
</if>
order by create_time desc
</where>
@@ -2942,10 +2942,19 @@ public class VehicleApplicationService {
if (!hasPilot1 && !hasPilot2) {
throw new IllegalArgumentException("请选择副驾");
}
UserDriverDTO userDriverDTO = new UserDriverDTO();
//将pilot1或是pilot2的id传给userDriverDTO,判断一下谁有值传谁
userDriverDTO.setUserId(Long.valueOf(hasPilot1 ? vehicleDto.getPilot1Id() : vehicleDto.getPilot2Id()));
userDriverDTO.setVehicleId(vehicleDto.getVehicleId());
// 更新
return vehicleMapper.updatePilotDriver(vehicleDto);
vehicleMapper.updatePilotDriver(vehicleDto);
userServiceFeign.bindVehicle(userDriverDTO);
return 1;
}
}
@@ -646,76 +646,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</update>
<update id="updatePilotDriver" parameterType="com.linke.transport.interfaces.dto.vehicle.VehicleDto">
<!-- 开启事务 -->
START TRANSACTION;
UPDATE ngwl_test_transport.vehicle v
SET
<choose>
<when test="pilot1Id!= null and pilot1Id != ''">
v.pilot1_id = #{pilot1Id},
v.pilot1 = #{pilot1}
</when>
<when test="pilot2Id != null and pilot2Id != ''">
v.pilot2_id = #{pilot2Id},
v.pilot2 = #{pilot2}
</when>
</choose>
<if test="pilot1Id != null and pilot1Id != ''">
v.pilot1_id = #{pilot1Id},
</if>
<if test="pilot1 != null and pilot1 != ''">
v.pilot1 = #{pilot1},
</if>
<if test="pilot2Id != null and pilot2Id != ''">
v.pilot2_id = #{pilot2Id},
</if>
<if test="pilot2 != null and pilot2 != ''">
v.pilot2 = #{pilot2},
</if>
v.update_time = NOW()
WHERE v.vehicle_id = #{vehicleId};
<!-- 插入或更新车辆与副驾的绑定关系 -->
INSERT INTO ngwl_test_user.driver_vehicle_bind
(user_id, vehicle_id, driver_bind_id, bind_driver_name, vehicle_license_plate_number, default_flag, del_flag, create_time, update_time)
SELECT
v.user_id,
v.vehicle_id,
<choose>
<when test="pilot1Id != null and pilot1Id != ''">
#{pilot1Id},
#{pilot1},
</when>
<when test="pilot2Id != null and pilot2Id != ''">
#{pilot2Id},
#{pilot2},
</when>
</choose>
v.vehicle_license_plate_number,
2,
1,
NOW(),
NOW()
FROM ngwl_test_transport.vehicle v
WHERE v.vehicle_id = #{vehicleId}
ON DUPLICATE KEY UPDATE
bind_driver_name = VALUES(bind_driver_name),
update_time = NOW();
<!-- 插入或更新ngwl_test_wlhy库的tms_driver表中副驾与车辆的关联 -->
INSERT INTO ngwl_test_wlhy.tms_driver
(driver_id, driver_name, vehicle_type_id, create_time, update_time)
VALUES
(
<choose>
<when test="pilot1Id != null and pilot1Id != ''">
#{pilot1Id},
#{pilot1},
</when>
<when test="pilot2Id != null and pilot2Id != ''">
#{pilot2Id},
#{pilot2},
</when>
</choose>
#{vehicleId},
NOW(),
NOW()
)
ON DUPLICATE KEY UPDATE
driver_name = VALUES(driver_name),
vehicle_type_id = VALUES(vehicle_type_id),
update_time = NOW();
<!-- 提交事务 -->
COMMIT;
</update>
<delete id="deleteVehicleByVehicleId" parameterType="Long">