Browse Source

印花税缴纳状态条件查询

yusm 1 tuần trước cách đây
mục cha
commit
49930fb74b

+ 5 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ContractController.java

@@ -17,6 +17,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -42,9 +43,10 @@ public class ContractController {
      * 分页查询合同
      */
     @RequestMapping("/getContractPage")
-    public HttpRespMsg getContractPage (HttpServletRequest request, @RequestParam Integer pageIndex, @RequestParam Integer pageSize, String number,String name,String typeName,Integer status,
-                                        String startDate,String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,@RequestParam(required = false) String customerOrg,@RequestParam(required = false) Integer finishStatus){
-        return contractService.getContractPage(request,pageIndex,pageSize,number,name,typeName,status,startDate,endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus);
+    public HttpRespMsg getContractPage (HttpServletRequest request, @RequestParam Integer pageIndex, @RequestParam Integer pageSize, String number, String name, String typeName, Integer status,
+                                        String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId, @RequestParam(required = false) String customerOrg, @RequestParam(required = false) Integer finishStatus
+    , Integer stampDutyStatus  ){
+        return contractService.getContractPage(request,pageIndex,pageSize,number,name,typeName,status,startDate,endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus);
     }
 
     /**

+ 9 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Contract.java

@@ -7,6 +7,7 @@ import java.time.LocalDate;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+import java.time.LocalDateTime;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
@@ -187,6 +188,14 @@ public class Contract extends Model<Contract> {
     @TableField(exist = false)
     private String projectName;
 
+    @TableField(exist = false)
+    private Integer stampDutyStatus;
+
+    @TableField(exist = false)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime stampDutyTime;
+
 
     @Override
     protected Serializable pkVal() {

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/ContractCustom.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+import java.time.LocalDateTime;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
@@ -138,7 +139,7 @@ public class ContractCustom extends Model<ContractCustom> {
     @TableField("stamp_duty_time")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Integer stampDutyTime;
+    private LocalDateTime stampDutyTime;
 
 
     @Override

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/ContractPayCustomized.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
+import java.time.LocalDateTime;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
@@ -99,7 +100,7 @@ public class ContractPayCustomized extends Model<ContractPayCustomized> {
     @TableField("stamp_duty_time")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private String stampDutyTime;
+    private LocalDateTime stampDutyTime;
 
 
     @Override

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ContractMapper.java

@@ -14,6 +14,6 @@ import java.util.List;
  * @since 2022-11-29
  */
 public interface ContractMapper extends BaseMapper<Contract> {
-    List<Contract> selectContract(Integer companyId, Integer pageStart, Integer pageSize, String number, String name, String typeName, Integer status, String startDate,String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus);
-    Long selectContractCnt(Integer companyId, String number, String name, String typeName, Integer status, String startDate,String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus);
+    List<Contract> selectContract(Integer companyId, Integer pageStart, Integer pageSize, String number, String name, String typeName, Integer status, String startDate,String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,Integer stampDutyStatus );
+    Long selectContractCnt(Integer companyId, String number, String name, String typeName, Integer status, String startDate,String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,Integer stampDutyStatus);
 }

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ContractService.java

@@ -21,7 +21,7 @@ import java.util.List;
  */
 public interface ContractService extends IService<Contract> {
 
-    HttpRespMsg getContractPage(HttpServletRequest request, Integer pageIndex, Integer pageSize, String number, String name, String typeName, Integer status, String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus);
+    HttpRespMsg getContractPage(HttpServletRequest request, Integer pageIndex, Integer pageSize, String number, String name, String typeName, Integer status, String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,Integer stampDutyStatus );
 
     HttpRespMsg ExportContract(HttpServletRequest request, String number, String name, String typeName, Integer status, String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus);
 

+ 11 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ContractServiceImpl.java

@@ -107,7 +107,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
     @Override
     public HttpRespMsg getContractPage(HttpServletRequest request, Integer pageIndex, Integer pageSize, String number, String name,
                                        String typeName, Integer status, String startDate, String endDate,
-                                       String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus) {
+                                       String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,Integer stampDutyStatus ) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         try {
             String token = request.getHeader("token");
@@ -140,8 +140,8 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
 //            if (StringUtils.isNotBlank(name)){
 //                name = "%" + name + "%";
 //            }
-            List<Contract> contracts = contractMapper.selectContract(user.getCompanyId(), pageStart, pageSize, number, name , typeName , status, startDate,endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus);
-            Long totalCnt = contractMapper.selectContractCnt(user.getCompanyId(), number, name, typeName, status, startDate, endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus);
+            List<Contract> contracts = contractMapper.selectContract(user.getCompanyId(), pageStart, pageSize, number, name , typeName , status, startDate,endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus);
+            Long totalCnt = contractMapper.selectContractCnt(user.getCompanyId(), number, name, typeName, status, startDate, endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus);
             for (Contract contract : contracts) {
                 if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
                     contract.setCreatorName(contract.getCreatorWxCorpId());
@@ -438,6 +438,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
         List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "管理全部合同");
+        boolean isAddPayRecord=false;
         if(functionContractList.size() <= 0){
             httpRespMsg.setError(MessageUtils.message("access.operationError"));
             return httpRespMsg;
@@ -480,6 +481,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
                         if (payCustomized.getIsPayed()) {
                             bg = bg.add(payCustomized.getPayedAmount());
                         }
+                        if (payCustomized.getReservedAmounts()==null){
+                            isAddPayRecord=true;
+                        }
                     }
                     contract.setPayment(bg);
                 }else {
@@ -525,6 +529,10 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
             contractLogMapper.insert(contractLog);
             if (user.getCompanyId() == 4215) {
                 custom.setContractId(contract.getId());
+                ContractCustom customSelect = contractCustomMapper.selectOne(new QueryWrapper<ContractCustom>().eq("contract_id", contract.getId()));
+                if (!customSelect.getIsAmountFixed()&&customSelect.getStampDutyStatus()==2&&isAddPayRecord){
+                    custom.setStampDutyStatus(3);
+                }
                 contractCustomMapper.updateById(custom);
             }
             httpRespMsg.msg = MessageUtils.message("contract.editSuc");

+ 8 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ContractMapper.xml

@@ -29,7 +29,8 @@
     <select id="selectContract" resultType="com.management.platform.entity.Contract">
         select contract.id,contract.company_id,contract.creator_id,contract.number,contract.name,contract.amounts,contract.type_id,contract_type.type_name,contract.status,contract.indate,contract.remarks,
         contract.start_date as startDate,contract.end_date as endDate,contract_type_sec.sec_type_name,contract.sec_type_id,
-        user.name as creatorName,user.corpwx_userid as creatorWxCorpId, contract.project_id, contract.payment, cp.pay_date AS next_payment_date, cp.amount AS next_payment_amount
+        user.name as creatorName,user.corpwx_userid as creatorWxCorpId, contract.project_id, contract.payment, cp.pay_date AS next_payment_date, cp.amount AS next_payment_amount,
+        cc.stamp_duty_status stampDutyStatus,cc.stamp_duty_time stampDutyTime
         from contract
         left join contract_type
         on contract.type_id = contract_type.id
@@ -66,6 +67,9 @@
         <if test="customerOrg!=null">
             and cc.customer_org like  CONCAT('%', #{customerOrg}, '%')
         </if>
+        <if test="stampDutyStatus!=null">
+            and cc.stamp_duty_status = #{stampDutyStatus}
+        </if>
         order by contract.number desc
         <if test="pageStart!=null and pageSize!=null">
             limit #{pageStart},#{pageSize}
@@ -108,5 +112,8 @@
         <if test="customerOrg!=null">
             and cc.customer_org like  CONCAT('%', #{customerOrg}, '%')
         </if>
+        <if test="stampDutyStatus!=null">
+            and cc.stamp_duty_status = #{stampDutyStatus}
+        </if>
     </select>
 </mapper>