Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

hy 7 years ago
parent
commit
9fc29b33ad
17 changed files with 459 additions and 23 deletions
  1. 34 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/EndProductDTO.java
  2. 87 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/MessagelogDTO.java
  3. 11 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Operation.java
  4. 37 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/EndProductController.java
  5. 22 4
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/MaxnumberController.java
  6. 18 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/EndProductMapper.java
  7. 2 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MaxnumbersMapper.java
  8. 1 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MessagelogMapper.java
  9. 15 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/EndProductService.java
  10. 8 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/MaxnumberService.java
  11. 90 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/EndProductServiceImpl.java
  12. 65 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/MaxnumberServiceImpl.java
  13. 3 1
      applications/commons/commons-server/src/main/resources/i18n/messages_zh_CN.properties
  14. 31 0
      applications/commons/commons-server/src/main/resources/mapper/EndProductMapper.xml
  15. 33 15
      applications/commons/commons-server/src/main/resources/mapper/MaxnumbersMapper.xml
  16. 1 1
      applications/document/document-server/src/main/resources/mapper/AddressMapper.xml
  17. 1 1
      applications/document/document-server/src/main/resources/mapper/CustomerkindMapper.xml

+ 34 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/EndProductDTO.java

@@ -0,0 +1,34 @@
+package com.usoftchina.saas.commons.dto;
+
+import com.usoftchina.saas.base.dto.CommonBaseDTO;
+import com.usoftchina.saas.commons.po.Messagelog;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 结账  返回数据
+ * @author chenwei
+ * @date 2018/10/31
+ */
+public class EndProductDTO extends CommonBaseDTO implements Serializable {
+
+    private String main;
+    private List<MessagelogDTO> items;
+
+    public String getMain() {
+        return main;
+    }
+
+    public void setMain(String main) {
+        this.main = main;
+    }
+
+    public List<MessagelogDTO> getItems() {
+        return items;
+    }
+
+    public void setItems(List<MessagelogDTO> items) {
+        this.items = items;
+    }
+}

+ 87 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/MessagelogDTO.java

@@ -0,0 +1,87 @@
+package com.usoftchina.saas.commons.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class MessagelogDTO implements Serializable {
+
+    private String ml_code;
+
+    private String ml_content;
+
+    private String ml_result;
+
+    private String ml_caller;
+
+    private String ml_man;
+
+    private Date createTime;
+
+    private Long companyId;
+
+    private Long ml_keyvalue;
+
+    public Long getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(Long companyId) {
+        this.companyId = companyId;
+    }
+
+    public Long getMl_keyvalue() {
+        return ml_keyvalue;
+    }
+
+    public void setMl_keyvalue(Long ml_keyvalue) {
+        this.ml_keyvalue = ml_keyvalue;
+    }
+
+    public String getMl_code() {
+        return ml_code;
+    }
+
+    public void setMl_code(String ml_code) {
+        this.ml_code = ml_code;
+    }
+
+    public String getMl_content() {
+        return ml_content;
+    }
+
+    public void setMl_content(String ml_content) {
+        this.ml_content = ml_content;
+    }
+
+    public String getMl_result() {
+        return ml_result;
+    }
+
+    public void setMl_result(String ml_result) {
+        this.ml_result = ml_result;
+    }
+
+    public String getMl_caller() {
+        return ml_caller;
+    }
+
+    public void setMl_caller(String ml_caller) {
+        this.ml_caller = ml_caller;
+    }
+
+    public String getMl_man() {
+        return ml_man;
+    }
+
+    public void setMl_man(String ml_man) {
+        this.ml_man = ml_man;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}

+ 11 - 1
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Operation.java

@@ -49,7 +49,17 @@ public enum Operation {
     /**
     /**
      * 禁用操作
      * 禁用操作
      */
      */
-    BANNED("msg.banned", "msg.bannedSuccess");
+    BANNED("msg.banned", "msg.bannedSuccess"),
+
+    /**
+     * 记账
+     */
+    ENDPRODUCT("msg.endProdudct", "msg.endProdudctSuccess"),
+
+    /**
+     * 反记账
+     */
+    UNENDPRODUCT("msg.unEndProduct", "msg.unEndProductSuccess");
 
 
     private final String title;
     private final String title;
     private final String result;
     private final String result;

+ 37 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/EndProductController.java

@@ -0,0 +1,37 @@
+package com.usoftchina.saas.commons.controller;
+
+import com.netflix.discovery.converters.Auto;
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.commons.service.EndProductService;
+import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 结账
+ */
+@RestController
+@RequestMapping("/endProduct")
+public class EndProductController {
+
+    @Autowired
+    private EndProductService endProductService;
+
+    @GetMapping("/list")
+    public Result getListData(PageRequest page, ListReqDTO listReqDTO){
+        return Result.success(endProductService.getPeriodData(page, listReqDTO));
+    }
+
+    @PostMapping("/endAccount")
+    public Result endAccount(){
+        return Result.success(endProductService.endAccount());
+    }
+
+    @PostMapping("/unEndAccount")
+    public Result unEndAccount(){
+
+        return Result.success();
+    }
+
+}

+ 22 - 4
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/MaxnumberController.java

@@ -2,13 +2,15 @@ package com.usoftchina.saas.commons.controller;
 
 
 
 
 import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.commons.po.Maxnumbers;
 import com.usoftchina.saas.commons.service.MaxnumberService;
 import com.usoftchina.saas.commons.service.MaxnumberService;
 
 
+import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import java.sql.ResultSet;
 
 
 /**
 /**
  * @author: guq
  * @author: guq
@@ -31,4 +33,20 @@ public class MaxnumberController {
                                 @RequestParam("caller") String caller) {
                                 @RequestParam("caller") String caller) {
         return Result.success(maxnumberService.pushMaxnubmer(count, code, caller));
         return Result.success(maxnumberService.pushMaxnubmer(count, code, caller));
     }
     }
+
+    @GetMapping("/list")
+    public Result getList(PageRequest page, ListReqDTO listReqDTO){
+        return Result.success(maxnumberService.getListData(page, listReqDTO));
+    }
+
+    @PostMapping("/save")
+    public Result save(@RequestBody Maxnumbers maxnumbers){
+        return Result.success(maxnumberService.saveData(maxnumbers));
+    }
+
+    @PostMapping("/delete/{id}")
+    public Result delete(@PathVariable("id") Long id){
+        maxnumberService.removeByPrimaryKey(id);
+        return Result.success();
+    }
 }
 }

+ 18 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/EndProductMapper.java

@@ -0,0 +1,18 @@
+package com.usoftchina.saas.commons.mapper;
+
+import com.usoftchina.saas.commons.dto.MessagelogDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface EndProductMapper {
+
+    void endProduct(Map<String, Object> map);
+
+    String selectPeriod(@Param("companyId") Long companyId);
+
+    List<MessagelogDTO> getListData(@Param("condition") String condition, @Param("companyId") Long companyId);
+
+    void updatePeriodStatus(@Param("status") Long status,@Param("period") String period, @Param("companyId") Long companyId);
+}

+ 2 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MaxnumbersMapper.java

@@ -31,4 +31,6 @@ public interface MaxnumbersMapper extends CommonBaseMapper<Maxnumbers>{
     int updateByPrimaryKeySelective(Maxnumbers record);
     int updateByPrimaryKeySelective(Maxnumbers record);
 
 
     int updateByPrimaryKey(Maxnumbers record);
     int updateByPrimaryKey(Maxnumbers record);
+
+    List<Maxnumbers> getListDataByCondition(@Param("condition") String condition, @Param("companyId") Long companyId);
 }
 }

+ 1 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MessagelogMapper.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.commons.mapper;
 package com.usoftchina.saas.commons.mapper;
 
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.MessagelogDTO;
 import com.usoftchina.saas.commons.po.Messagelog;
 import com.usoftchina.saas.commons.po.Messagelog;
 import com.usoftchina.saas.commons.po.MessagelogExample;
 import com.usoftchina.saas.commons.po.MessagelogExample;
 import java.util.List;
 import java.util.List;

+ 15 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/EndProductService.java

@@ -0,0 +1,15 @@
+package com.usoftchina.saas.commons.service;
+
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.page.PageRequest;
+
+import java.util.Map;
+
+public interface EndProductService{
+
+    Map<String, Object> getPeriodData(PageRequest page, ListReqDTO listReqDTO);
+
+    String endAccount();
+
+    void unEndAccount();
+}

+ 8 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/MaxnumberService.java

@@ -1,8 +1,12 @@
 package com.usoftchina.saas.commons.service;
 package com.usoftchina.saas.commons.service;
 
 
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseService;
 import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.mapper.MaxnumbersMapper;
 import com.usoftchina.saas.commons.mapper.MaxnumbersMapper;
 import com.usoftchina.saas.commons.po.Maxnumbers;
 import com.usoftchina.saas.commons.po.Maxnumbers;
+import com.usoftchina.saas.page.PageRequest;
 
 
 /**
 /**
  * @author: guq
  * @author: guq
@@ -12,4 +16,8 @@ public interface MaxnumberService extends CommonBaseService<MaxnumbersMapper, Ma
     String getMaxnumner(String caller, boolean update);
     String getMaxnumner(String caller, boolean update);
 
 
     String pushMaxnubmer(Integer count, String code, String caller);
     String pushMaxnubmer(Integer count, String code, String caller);
+
+    PageInfo<Maxnumbers> getListData(PageRequest page, ListReqDTO listReqDTO);
+
+    DocBaseDTO saveData(Maxnumbers maxnumbers);
 }
 }

+ 90 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/EndProductServiceImpl.java

@@ -0,0 +1,90 @@
+package com.usoftchina.saas.commons.service.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.commons.dto.MessagelogDTO;
+import com.usoftchina.saas.commons.mapper.EndProductMapper;
+import com.usoftchina.saas.commons.mapper.MessagelogMapper;
+import com.usoftchina.saas.commons.po.Operation;
+import com.usoftchina.saas.commons.service.EndProductService;
+import com.usoftchina.saas.commons.service.MessageLogService;
+import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.exception.BizException;
+import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class EndProductServiceImpl implements EndProductService {
+
+    @Autowired
+    private MessageLogService messageLogService;
+    @Autowired
+    private MessagelogMapper messagelogMapper;
+    @Autowired
+    private EndProductMapper endProductMapper;
+
+    @Override
+    public Map<String, Object> getPeriodData(PageRequest page, ListReqDTO listReqDTO) {
+        //设置分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        //condition语句
+        String condition = listReqDTO.getFinalCondition();
+        if(condition == null){
+            condition = "1=1";
+        }
+        List<MessagelogDTO> messagelogDTOS = endProductMapper.getListData(condition, BaseContextHolder.getCompanyId());
+        //取分页信息
+        PageInfo<MessagelogDTO> pageInfo = new PageInfo<MessagelogDTO>(messagelogDTOS);
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("main", endProductMapper.selectPeriod(BaseContextHolder.getCompanyId()));
+        map.put("item",pageInfo);
+        return map;
+    }
+
+    @Override
+    public String endAccount() {
+        String period = endProductMapper.selectPeriod(BaseContextHolder.getCompanyId());
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("yearMonth", period);
+        map.put("companyId", BaseContextHolder.getCompanyId());
+        map.put("result", null);
+        endProductMapper.endProduct(map);
+        endProductMapper.updatePeriodStatus(99L, period, BaseContextHolder.getCompanyId());
+        DocBaseDTO docBaseDTO = generateMsgObj(Long.parseLong(period));
+        messageLogService.customizeLog(docBaseDTO, Operation.ENDPRODUCT);
+        return String.valueOf(map.get("result"));
+    }
+
+    @Override
+    public void unEndAccount() {
+        String period = endProductMapper.selectPeriod(BaseContextHolder.getCompanyId());
+        if (StringUtils.isEmpty(period)){
+            throw new BizException(79306,"系统还未结账,不能反结账");
+        }else{
+            endProductMapper.updatePeriodStatus(0L, period, BaseContextHolder.getCompanyId());
+            messageLogService.customizeLog(generateMsgObj(Long.parseLong(period)), Operation.UNENDPRODUCT);
+        }
+    }
+    /**
+     * 构造 记录日志对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, null, "EndProduct");
+    }
+
+}

+ 65 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/MaxnumberServiceImpl.java

@@ -1,6 +1,10 @@
 package com.usoftchina.saas.commons.service.impl;
 package com.usoftchina.saas.commons.service.impl;
 
 
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.mapper.MaxnumbersMapper;
 import com.usoftchina.saas.commons.mapper.MaxnumbersMapper;
 import com.usoftchina.saas.commons.mapper.MaxnumbersdetailMapper;
 import com.usoftchina.saas.commons.mapper.MaxnumbersdetailMapper;
@@ -9,15 +13,18 @@ import com.usoftchina.saas.commons.po.MaxnumbersExample;
 import com.usoftchina.saas.commons.po.Maxnumbersdetail;
 import com.usoftchina.saas.commons.po.Maxnumbersdetail;
 import com.usoftchina.saas.commons.po.MaxnumbersdetailExample;
 import com.usoftchina.saas.commons.po.MaxnumbersdetailExample;
 import com.usoftchina.saas.commons.service.MaxnumberService;
 import com.usoftchina.saas.commons.service.MaxnumberService;
+import com.usoftchina.saas.commons.service.MessageLogService;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.context.BaseContextHolder;
 
 
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.exception.BizException;
+import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.utils.DateUtils;
 import com.usoftchina.saas.utils.DateUtils;
 
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import java.util.Date;
 import java.util.Date;
+import java.util.List;
 
 
 
 
 /**
 /**
@@ -31,6 +38,8 @@ public class MaxnumberServiceImpl extends CommonBaseServiceImpl<MaxnumbersMapper
     private MaxnumbersMapper maxnumbersMapper;
     private MaxnumbersMapper maxnumbersMapper;
     @Autowired
     @Autowired
     private MaxnumbersdetailMapper maxnumbersdetailMapper;
     private MaxnumbersdetailMapper maxnumbersdetailMapper;
+    @Autowired
+    private MessageLogService messageLogService;
 
 
     /**
     /**
     * @Description
     * @Description
@@ -144,6 +153,53 @@ public class MaxnumberServiceImpl extends CommonBaseServiceImpl<MaxnumbersMapper
         return maxcode;
         return maxcode;
     }
     }
 
 
+    @Override
+    public PageInfo<Maxnumbers> getListData(PageRequest page, ListReqDTO listReqDTO) {
+        //设置分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        //condition语句
+        String condition = listReqDTO.getFinalCondition();
+        if(condition == null){
+            condition = "1=1";
+        }
+
+        List<Maxnumbers> maxnumbersList = getMapper().getListDataByCondition(condition, BaseContextHolder.getCompanyId());
+        //取分页信息
+        PageInfo<Maxnumbers> pageInfo = new PageInfo<Maxnumbers>(maxnumbersList);
+        return pageInfo;
+    }
+
+    @Override
+    public DocBaseDTO saveData(Maxnumbers maxnumbers) {
+        DocBaseDTO docBaseDTO = null;
+        if(maxnumbers.getId() == 0){
+            //保存
+            maxnumbers.setCompanyId(BaseContextHolder.getCompanyId());
+            maxnumbers.setCreatorId(BaseContextHolder.getUserId());
+            maxnumbers.setCreateTime(new Date());
+
+            getMapper().insertSelective(maxnumbers);
+            //记录LOG
+            docBaseDTO = generateMsgObj(maxnumbers.getId());
+            messageLogService.save(docBaseDTO);
+        }else{
+            //更新
+            maxnumbers.setUpdaterId(BaseContextHolder.getUserId());
+            maxnumbers.setUpdateTime(new Date());
+
+            getMapper().updateByPrimaryKeySelective(maxnumbers);
+            //记录LOG
+            docBaseDTO = generateMsgObj(maxnumbers.getId());
+            messageLogService.update(docBaseDTO);
+        }
+        return docBaseDTO;
+    }
+
     /**
     /**
     * @Description
     * @Description
     * 根据长度跳流水号
     * 根据长度跳流水号
@@ -229,4 +285,13 @@ public class MaxnumberServiceImpl extends CommonBaseServiceImpl<MaxnumbersMapper
         return rulecode += date;
         return rulecode += date;
     }
     }
 
 
+    /**
+     * 构造日记记录对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, null, "Maxnumber");
+    }
+
 }
 }

+ 3 - 1
applications/commons/commons-server/src/main/resources/i18n/messages_zh_CN.properties

@@ -114,4 +114,6 @@ msg.CopySuccess=\u590d\u5236\u6210\u529f,\u6765\u6e90\u5355\u53f7\uff1a
 msg.getBill=\u83b7\u53d6\u53d1\u7968\u660e\u7ec6
 msg.getBill=\u83b7\u53d6\u53d1\u7968\u660e\u7ec6
 msg.getARBill=\u83b7\u53d6\u5e94\u6536\u53d1\u7968
 msg.getARBill=\u83b7\u53d6\u5e94\u6536\u53d1\u7968
 msg.getAPBill=\u83b7\u53d6\u5e94\u4ed8\u53d1\u7968
 msg.getAPBill=\u83b7\u53d6\u5e94\u4ed8\u53d1\u7968
-msg.getSuccess=\u83b7\u53d6\u6210\u529f
+msg.getSuccess=\u83b7\u53d6\u6210\u529f
+msg.endProdudct=\u8bb0\u8d26\u64cd\u4f5c
+msg.endProdudctSuccess=\u7ed3\u8d26\u6210\u529f

+ 31 - 0
applications/commons/commons-server/src/main/resources/mapper/EndProductMapper.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.commons.mapper.EndProductMapper" >
+    <parameterMap id="spParamMap" type="java.util.Map">
+        <parameter property="yearMonth" jdbcType="VARCHAR" mode="IN" />
+        <parameter property="companyId" jdbcType="VARCHAR" mode="IN" />
+        <parameter property="result" jdbcType="VARCHAR" mode="OUT" />
+    </parameterMap>
+
+    <select id="selectPeriod" resultType="string">
+        select PD_DETNO from periodsdetail where companyid=#{companyId} and pd_status=0 order by PD_DETNO LIMIT 1;
+    </select>
+    <resultMap id="MsgResult" type="com.usoftchina.saas.commons.dto.MessagelogDTO">
+        <result column="ml_content" property="ml_content" jdbcType="VARCHAR" />
+        <result column="ml_result" property="ml_result" jdbcType="VARCHAR" />
+        <result column="ml_man" property="ml_man" jdbcType="VARCHAR" />
+        <result column="companyId" property="companyId" jdbcType="INTEGER" />
+        <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
+        <result column="ml_keyvalue" property="ml_keyvalue" jdbcType="INTEGER" />
+    </resultMap>
+    <select id="getListData" resultMap="MsgResult">
+        SELECT * FROM MESSAGELOG WHERE ML_CALLER='EndProduct' AND COMPANYID=#{companyId} AND ml_result='记账成功'
+    </select>
+
+    <select id="endProduct" parameterMap="spParamMap" statementType="CALLABLE">
+        CALL SP_ENDPRODUCT(?, ?, ?)
+    </select>
+    <update id="updatePeriodStatus" >
+        update periodsdetail set pd_status=#{status} where pd_detno=#{period} and companyId=#{companyId}
+    </update>
+</mapper>

+ 33 - 15
applications/commons/commons-server/src/main/resources/mapper/MaxnumbersMapper.xml

@@ -88,15 +88,15 @@
       order by ${orderByClause}
       order by ${orderByClause}
     </if>
     </if>
   </select>
   </select>
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
     select 
     select 
     <include refid="Base_Column_List" />
     <include refid="Base_Column_List" />
     from maxnumbers
     from maxnumbers
-    where mn_id = #{id,jdbcType=INTEGER}
+    where mn_id = #{id}
   </select>
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
     delete from maxnumbers
     delete from maxnumbers
-    where mn_id = #{id,jdbcType=INTEGER}
+    where mn_id = #{id}
   </delete>
   </delete>
   <delete id="deleteByExample" parameterType="com.usoftchina.saas.commons.po.MaxnumbersExample" >
   <delete id="deleteByExample" parameterType="com.usoftchina.saas.commons.po.MaxnumbersExample" >
     delete from maxnumbers
     delete from maxnumbers
@@ -105,27 +105,30 @@
     </if>
     </if>
   </delete>
   </delete>
   <insert id="insert" parameterType="com.usoftchina.saas.commons.po.Maxnumbers" >
   <insert id="insert" parameterType="com.usoftchina.saas.commons.po.Maxnumbers" >
-    insert into maxnumbers (mn_id, mn_caller, mn_leadcode, 
+    insert into maxnumbers (mn_caller, mn_leadcode,
       mn_number, companyId, createTime, 
       mn_number, companyId, createTime, 
       creatorId, updateTime, updaterId
       creatorId, updateTime, updaterId
       )
       )
-    values (#{id,jdbcType=INTEGER}, #{mn_caller,jdbcType=VARCHAR}, #{mn_leadcode,jdbcType=VARCHAR},
+    values (#{mn_caller,jdbcType=VARCHAR}, #{mn_leadcode,jdbcType=VARCHAR},
       #{mn_number,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
       #{mn_number,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
       #{creatorId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=INTEGER}
       #{creatorId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=INTEGER}
       )
       )
   </insert>
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.commons.po.Maxnumbers" >
   <insert id="insertSelective" parameterType="com.usoftchina.saas.commons.po.Maxnumbers" >
+      <selectKey resultType="java.lang.Long" keyProperty="id">
+          SELECT LAST_INSERT_ID() AS ID
+      </selectKey>
     insert into maxnumbers
     insert into maxnumbers
     <trim prefix="(" suffix=")" suffixOverrides="," >
     <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="id != null" >
-        mn_id,
-      </if>
       <if test="mn_caller != null" >
       <if test="mn_caller != null" >
         mn_caller,
         mn_caller,
       </if>
       </if>
       <if test="mn_leadcode != null" >
       <if test="mn_leadcode != null" >
         mn_leadcode,
         mn_leadcode,
       </if>
       </if>
+      <if test="mn_rule != null" >
+          mn_rule,
+      </if>
       <if test="mn_number != null" >
       <if test="mn_number != null" >
         mn_number,
         mn_number,
       </if>
       </if>
@@ -146,15 +149,15 @@
       </if>
       </if>
     </trim>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
     <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="id != null" >
-        #{id,jdbcType=INTEGER},
-      </if>
       <if test="mn_caller != null" >
       <if test="mn_caller != null" >
         #{mn_caller,jdbcType=VARCHAR},
         #{mn_caller,jdbcType=VARCHAR},
       </if>
       </if>
       <if test="mn_leadcode != null" >
       <if test="mn_leadcode != null" >
         #{mn_leadcode,jdbcType=VARCHAR},
         #{mn_leadcode,jdbcType=VARCHAR},
       </if>
       </if>
+      <if test="mn_rule != null" >
+        #{mn_rule,jdbcType=VARCHAR},
+      </if>
       <if test="mn_number != null" >
       <if test="mn_number != null" >
         #{mn_number,jdbcType=VARCHAR},
         #{mn_number,jdbcType=VARCHAR},
       </if>
       </if>
@@ -175,7 +178,7 @@
       </if>
       </if>
     </trim>
     </trim>
   </insert>
   </insert>
-  <select id="countByExample" parameterType="com.usoftchina.saas.commons.po.MaxnumbersExample" resultType="java.lang.Integer" >
+  <select id="countByExample" parameterType="com.usoftchina.saas.commons.po.MaxnumbersExample" resultType="java.lang.Long" >
     select count(*) from maxnumbers
     select count(*) from maxnumbers
     <if test="_parameter != null" >
     <if test="_parameter != null" >
       <include refid="Example_Where_Clause" />
       <include refid="Example_Where_Clause" />
@@ -240,6 +243,9 @@
       <if test="mn_leadcode != null" >
       <if test="mn_leadcode != null" >
         mn_leadcode = #{mn_leadcode,jdbcType=VARCHAR},
         mn_leadcode = #{mn_leadcode,jdbcType=VARCHAR},
       </if>
       </if>
+      <if test="mn_rule != null" >
+        mn_rule = #{mn_rule,jdbcType=VARCHAR},
+      </if>
       <if test="mn_number != null" >
       <if test="mn_number != null" >
         mn_number = #{mn_number,jdbcType=VARCHAR},
         mn_number = #{mn_number,jdbcType=VARCHAR},
       </if>
       </if>
@@ -259,7 +265,7 @@
         updaterId = #{updaterId,jdbcType=INTEGER},
         updaterId = #{updaterId,jdbcType=INTEGER},
       </if>
       </if>
     </set>
     </set>
-    where mn_id = #{id,jdbcType=INTEGER}
+    where mn_id = #{id}
   </update>
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.commons.po.Maxnumbers" >
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.commons.po.Maxnumbers" >
     update maxnumbers
     update maxnumbers
@@ -271,6 +277,18 @@
       creatorId = #{creatorId,jdbcType=INTEGER},
       creatorId = #{creatorId,jdbcType=INTEGER},
       updateTime = #{updateTime,jdbcType=TIMESTAMP},
       updateTime = #{updateTime,jdbcType=TIMESTAMP},
       updaterId = #{updaterId,jdbcType=INTEGER}
       updaterId = #{updaterId,jdbcType=INTEGER}
-    where mn_id = #{id,jdbcType=INTEGER}
+    where mn_id = #{id}
   </update>
   </update>
+    <select id="getListDataByCondition" resultMap="BaseResultMap">
+        SELECT * FROM MAXNUMBERS
+        <where>
+            <if test="condition">
+                ${condition}
+            </if>
+            <if test="companyId">
+                and COMPANYID=#{companyId}
+            </if>
+        </where>
+        ORDER BY MN_ID DESC
+    </select>
 </mapper>
 </mapper>

+ 1 - 1
applications/document/document-server/src/main/resources/mapper/AddressMapper.xml

@@ -182,7 +182,7 @@
     SELECT * FROM ADDRESS
     SELECT * FROM ADDRESS
   </select>
   </select>
   <select id="selectCountByName" resultType="int">
   <select id="selectCountByName" resultType="int">
-    SELECT * FROM ADDRESS WHERE AD_ADDRESS=#{name} AND COMPANYID=#{companyId}
+    SELECT count(*) FROM ADDRESS WHERE AD_ADDRESS=#{name} AND COMPANYID=#{companyId}
   </select>
   </select>
     <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
     <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
         SELECT AD_ADDRESS display,AD_ADDRESS value FROM ADDRESS WHERE COMPANYID=#{companyId}
         SELECT AD_ADDRESS display,AD_ADDRESS value FROM ADDRESS WHERE COMPANYID=#{companyId}

+ 1 - 1
applications/document/document-server/src/main/resources/mapper/CustomerkindMapper.xml

@@ -126,6 +126,6 @@
     SELECT ck_name display,ck_name value FROM CUSTOMERKIND WHERE COMPANYID=#{companyId}
     SELECT ck_name display,ck_name value FROM CUSTOMERKIND WHERE COMPANYID=#{companyId}
   </select>
   </select>
     <select id="selectCountByName" resultType="int">
     <select id="selectCountByName" resultType="int">
-        SELECT * FROM CUSTOMERKIND WHERE CK_NAME=#{name} AND COMPANYID=#{companyId}
+        SELECT count(*) FROM CUSTOMERKIND WHERE CK_NAME=#{name} AND COMPANYID=#{companyId}
     </select>
     </select>
 </mapper>
 </mapper>