Commit 7a50c5d3 by yinyong

用户、物流费用单更改

parent 3f31537b
## 百伦费用系统
项目流转: 符式酉 -> 李灿浩 ->吴通
项目流转: 符式酉 -> 李灿浩 ->吴通 ->尹勇
### 流程图
![流程图](http://dcfile.blsct.com/%E8%B4%B9%E7%94%A8%E7%B3%BB%E7%BB%9F%E9%80%BB%E8%BE%91.png)
......
......@@ -8,6 +8,8 @@ import com.blt.other.other_commons.utils.AxiosUtil;
import com.blt.other.other_database.model.BuyUserDomain;
import com.blt.other.other_database.model.UserDomain;
import com.blt.other.other_supplier.service.BuyUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
......@@ -15,6 +17,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -23,6 +26,8 @@ import java.util.Map;
@RequestMapping(value = "user")
public class UserController {
private static Logger logger = LoggerFactory.getLogger(UserController.class);
@Autowired
private UserService userService;
@Autowired
......@@ -65,6 +70,24 @@ public class UserController {
return userByCookie;
}
@PostMapping("/addUserMsg")
public Map<String, Object> addUserMsg(HttpServletRequest request, HttpServletResponse response, UserDomain userDomain) {
AxiosUtil.setCors(response,request);
Map<String, Object> map = new HashMap<>();
UserDomain oldUser = userService.findByUserid(userDomain.getUserid());
if(oldUser != null) {
int num = userService.updateUser(userDomain);
}else {
logger.warn("新增用户,用户信息:" + userDomain.toString());
userDomain.setCreatetime(new Date());
userDomain.setIsadmin(0);
userDomain.setIsfinansys(0);
userService.insertUser(userDomain);
}
map.put("success", true);
return map;
}
@PostMapping("/getUserMsgByCode")
public UserDomain getUserMsgByCode(HttpServletResponse response,HttpServletRequest request){
AxiosUtil.setCors(response,request);
......
......@@ -22,10 +22,16 @@ public interface UserDao {
Integer update(UserDomain userDomain);
Integer insertUser(UserDomain userDomain);
Integer insertUserNew(UserDomain userDomain);
Integer insert(UserDomain userDomain);
UserDomain selectByuserid(Integer userid);
UserDomain findByUsername(String username);
List<UserDomain> selectByKey(String key);
List<UserDomain> selectAdmins();
......
......@@ -15,8 +15,14 @@ public interface UserService {
UserDomain findByUserid(int parseInt);
UserDomain findByUsername(String username);
Integer updateUser(UserDomain user);
Integer insertUser(UserDomain user);
Integer insertUserNew(UserDomain userDomain);
List<UserDomain> getListByKey(String key);
List<UserDomain> getAllAdmins();
......
......@@ -78,11 +78,26 @@ public class UserServiceImpl implements UserService {
}
@Override
public UserDomain findByUsername(String username) {
return userDao.findByUsername(username);
}
@Override
public Integer updateUser(UserDomain user) {
return userDao.update(user);
}
@Override
public Integer insertUser(UserDomain user) {
return userDao.insertUser(user);
}
@Override
public Integer insertUserNew(UserDomain userDomain) {
return userDao.insertUserNew(userDomain);
}
@Override
public List<UserDomain> getListByKey(String key) {
List<UserDomain> userDomains = userDao.selectByKey(key);
return userDomains;
......
package com.blt.other.other_cost.controller;
import com.blt.other.other_commons.utils.DateTimeUtil;
import com.blt.other.other_cost.dto.LogisticsCostDto;
import com.blt.other.other_cost.dto.ManageCostDto;
import com.blt.other.other_cost.service.CostApiService;
import com.blt.other.other_cost.service.CostService;
import com.blt.other.other_database.model.CostDomain;
import com.blt.other.other_purchasing.dto.BuyListDto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -96,6 +93,36 @@ public class CostApiController {
return result;
}
@GetMapping("/logisticsCostList")
public Map<String, Object> logisticsCostList(@RequestParam(name = "startDate", required = false) String startDateStr,
@RequestParam(name = "endDate", required = false) String endDateStr,
@RequestParam(name = "feeSuperType", required = false) String feeSuperType,
@RequestParam(name = "feeSubType", required = false) String feeSubType,
@RequestParam(name = "companyValue", required = false) Integer companyValue,
@RequestParam(name = "companyName", required = false) String companyName,
@RequestParam(name = "departmentName", required = false) String departmentName,
@RequestParam(name = "createUserId", required = false) Integer createUserId,
@RequestParam(name = "payUserId", required = false) Integer payUserId) {
Map<String,Object> result = new HashMap<>();
try {
if (!StringUtils.isEmpty(departmentName)){
departmentName = departmentName.toLowerCase();
}
List<ManageCostDto> manageCostDtoList = costApiService.getLogisticsCostList(startDateStr, endDateStr, feeSuperType, feeSubType, companyValue, companyName, departmentName, createUserId, payUserId);
result.put("success", true);
result.put("data", manageCostDtoList);
} catch (ParseException e) {
e.printStackTrace();
result.put("success", false);
} catch (Exception e) {
e.printStackTrace();
result.put("success", false);
}
return result;
}
@GetMapping("/balanceSheetCost")
public Map<String, Object> balanceSheetCostList(@RequestParam(name = "startDate") String startDateStr,
@RequestParam(name = "endDate") String endDateStr){
......
......@@ -99,6 +99,11 @@ public interface CostDao {
@Param("companyName")String companyName, @Param("departmentName") String departmentName,
@Param("createUserId") Integer createUserId, @Param("payUserId") Integer payUserId);
List<ManageCostDto> getLogisticsCostList(@Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("feeSuperType") String feeSuperType,
@Param("feeSubType") String feeSubType, @Param("companyValueList") List<Integer> companyValueList,
@Param("companyName")String companyName, @Param("departmentName") String departmentName,
@Param("createUserId") Integer createUserId, @Param("payUserId") Integer payUserId);
/**
* 查询资产负债表相关费用单
* @param startDate
......
......@@ -29,6 +29,8 @@ public interface CostApiService {
*/
List<ManageCostDto> getMangeCostList(String startDateStr, String endDateStr, String feeSuperType, String feeSubType, Integer companyValue, String companyName, String departmentName,Integer createUserId, Integer payUserId) throws Exception;
List<ManageCostDto> getLogisticsCostList(String startDateStr, String endDateStr, String feeSuperType, String feeSubType, Integer companyValue, String companyName, String departmentName,Integer createUserId, Integer payUserId) throws Exception;
/**
* 查询资产负债表相关费用单
* @param startDate
......
......@@ -215,6 +215,32 @@ public class CostApiServiceImpl implements CostApiService {
}
@Override
public List<ManageCostDto> getLogisticsCostList(String startDateStr, String endDateStr, String feeSuperType, String feeSubType, Integer companyValue, String companyName, String departmentName, Integer createUserId, Integer payUserId) throws Exception {
Date startDate = null;
Date endDate = null;
if(!StringUtils.isEmpty(startDateStr)){
startDate = DateTimeUtil.stringToDate(startDateStr, DateTimeUtil.DATE_FORMAT);
}
if(!StringUtils.isEmpty(endDateStr)){
endDate = DateTimeUtil.stringToDate(endDateStr, DateTimeUtil.DATE_FORMAT);
}
ArrayList<Integer> companyValueList = new ArrayList<>(6);
if (companyValue != null) {
companyValueList.add(companyValue);
if (companyValue.equals(53)) {
companyValueList.add(50);
companyValueList.add(59);
companyValueList.add(60);
companyValueList.add(61);
companyValueList.add(66);
}
}
List<ManageCostDto> manageCostDtoList = costDao.getLogisticsCostList(startDate, DateTimeUtil.addDays(endDate, 1), feeSuperType, feeSubType, companyValueList, companyName, departmentName, createUserId, payUserId);
return manageCostDtoList;
}
@Override
public List<CostDomain> getBalanceSheetCost(Date startDate, Date endDate){
return costDao.selectBalanceSheetCost(startDate, endDate);
}
......
......@@ -7,6 +7,7 @@ import java.util.Date;
public class UserDomain {
private Integer id;
private Integer userid;
private Integer useridsso;
private String username;
private String useraccount;
private String usercode;
......@@ -39,6 +40,14 @@ public class UserDomain {
this.userid = userid;
}
public Integer getUseridsso() {
return useridsso;
}
public void setUseridsso(Integer useridsso) {
this.useridsso = useridsso;
}
public String getUsername() {
return username;
}
......
......@@ -385,7 +385,7 @@
UNION
SELECT c1.cost_no no,c1.bank_company receiveUnit,c1.cost_reason reason,c1.pay_time payTime,c1.cost_form manageCostType,u.departmentname1 departmentName,
c1.company_value companyValue,c1.company_name companyName,t.manage_cost_type feeSuperType,c1.kind_name feeSubType,-c1.amount amount,c1.dic currency,
-c1.amount_rmb amountRmb
-c1.amount * c1.to_rmb_rate amountRmb
FROM user u, type_relation t ,cost c1
WHERE c1.create_userid = u.userid AND t.fee_type = c1.type_name AND c1.cost_form = 2 AND c1.cost_status = 4
AND c1.company_value =2 AND c1.kind_name not in ('百伦咨询服务费','物流费')
......@@ -409,7 +409,7 @@
UNION
SELECT c1.cost_no no,c1.bank_company receiveUnit,c1.cost_reason reason,c1.pay_time payTime,c1.cost_form manageCostType,u.departmentname1 departmentName,
c1.company_value companyValue,c1.company_name companyName,t.manage_cost_type feeSuperType,c1.kind_name feeSubType,-c1.amount amount,c1.dic currency,
-c1.amount_rmb amountRmb
-c1.amount * c1.to_rmb_rate amountRmb
FROM user u, type_relation t ,cost c1
WHERE c1.create_userid = u.userid AND t.fee_type = c1.type_name AND c1.cost_form = 2 AND c1.cost_status = 4
AND c1.company_value in (1,3,5,7,8,11,46,48,50,53,59,60,61,66,69) AND c1.kind_name not in ('百伦咨询服务费')
......@@ -432,8 +432,8 @@
<if test="endDate != null">AND c1.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT c.cost_no no,c.bank_company receiveUnit,c.cost_reason reason,c.pay_time payTime,c.cost_form manageCostType,u.departmentname1 departmentName,
c.company_value companyValue,c.company_name companyName,t.manage_cost_type feeSuperType,c.kind_name feeSubType,c.amount amount,c.dic currency,
c.amount_rmb amountRmb
c.company_value companyValue,c.company_name companyName,t.manage_cost_type feeSuperType,c.kind_name feeSubType,c.amount amount,c.dic currency,
c.amount * c.to_rmb_rate amountRmb
FROM user u, cost c, type_relation t
WHERE c.create_userid = u.userid AND t.fee_type = c.type_name AND c.cost_form = 3 AND c.is_lend = 2 AND c.cost_status = 4
AND c.company_value in (1,2,3,5,7,8,11,46,48,50,53,59,60,61,66,69) AND c.kind_name not in ('百伦咨询服务费')
......@@ -472,6 +472,50 @@
<if test="endDate != null">AND b.pay_time <![CDATA[<]]>#{endDate}</if>
</select>
<select id="getLogisticsCostList" resultType="com.blt.other.other_cost.dto.ManageCostDto">
SELECT c.cost_no no,c.bank_company receiveUnit,d.cost_reason reason,c.pay_time payTime,c.cost_form
manageCostType,u.departmentname1 departmentName,
c.company_value companyValue,c.company_name companyName,t.manage_cost_type feeSuperType,d.kind_name
feeSubType,d.amount amount,c.dic currency,
d.amount * c.to_rmb_rate amountRmb
FROM user u, cost c, cost_detail d, type_relation t
WHERE c.create_userid = u.userid AND c.cost_no = d.cost_no AND t.fee_type = c.type_name AND c.cost_form = 1 AND
c.cost_status = 4
AND d.kind_name = '物流费'
<if test="startDate != null">AND c.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT c1.cost_no no,c1.bank_company receiveUnit,c1.cost_reason reason,c1.pay_time payTime,c1.cost_form manageCostType,u.departmentname1 departmentName,
c1.company_value companyValue,c1.company_name companyName,t.manage_cost_type feeSuperType,c1.kind_name feeSubType,-c1.amount amount,c1.dic currency,
-c1.amount * c1.to_rmb_rate amountRmb
FROM user u, type_relation t ,cost c1
WHERE c1.create_userid = u.userid AND t.fee_type = c1.type_name AND c1.cost_form = 2 AND c1.cost_status = 4
AND d.kind_name = '物流费'
<if test="startDate != null">AND c.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT c.cost_no no,c.bank_company receiveUnit,c.cost_reason reason,c.pay_time payTime,c.cost_form
manageCostType,u.departmentname1 departmentName,
c.company_value companyValue,c.company_name companyName,t.manage_cost_type feeSuperType,c.kind_name
feeSubType,c.amount amount,c.dic currency,
c.amount * c.to_rmb_rate amountRmb
FROM user u, cost c, type_relation t
WHERE c.create_userid = u.userid AND t.fee_type = c.type_name AND c.cost_form = 3 AND c.is_lend = 2 AND
c.cost_status = 4
AND c.kind_name = '物流费'
<if test="startDate != null">AND c.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT b.buyno no,b.suppliername receiveUnit,b.note reason,b.pay_time payTime,0 as
manageCostType,b.departmentname departmentName,
b.company_value companyValue,b.company companyName,b.sku_type_name feeSuperType,b.sku_type_name feeSubType,
b.amount amount,'CNY',b.amount amountRmb FROM buy b
WHERE b.sku_type_name = '物流费'
and b.buystatus <![CDATA[>]]> 3 and b.buystatus <![CDATA[<]]> 7 and b.buy_type <![CDATA[<]]> 3
<if test="startDate != null">AND b.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND b.pay_time <![CDATA[<]]>#{endDate}</if>
</select>
<!--
资产负债表相关费用单
1、已完成状态的所有费用类型借支单
......
......@@ -39,6 +39,7 @@
user
<set>
<if test="userid != null">userid=#{userid},</if>
<if test="useridsso != null">useridsso=#{useridsso},</if>
<if test="username != null">username=#{username},</if>
<if test="useraccount != null">useraccount=#{useraccount},</if>
<if test="usercode != null">usercode=#{usercode},</if>
......@@ -64,13 +65,53 @@
userid = #{userid}
</update>
<insert id="insertUser">
insert into
user(userid,useridsso,username,useraccount,usercode,jobs,sex,rztype,
state,departmentname1,departmentname2,departmentpath,
createtime,lastupdatetime,logincount,logintime,logo, remark,
sign,isvalid,isadmin,isfinansys
)
VALUE
(
#{userid},#{useridsso},#{username},#{useraccount},#{usercode},#{jobs},#{sex},#{rztype},
#{state},#{departmentname1},#{departmentname2},#{departmentpath},
#{createtime},#{lastupdatetime},#{logincount},#{logintime},#{logo}, #{remark},
#{sign},#{isvalid},#{isadmin},#{isfinansys}
)
</insert>
<insert id="insertUserNew">
insert into
user_new(
userid,username,useraccount,usercode,
departmentname1,departmentname2,departmentpath
)
value(
#{userid},#{username},#{useraccount},#{usercode},
#{departmentname1},#{departmentname2},#{departmentpath}
)
on duplicate key update
userid = values(userid), username = values(username), useraccount = #{useraccount},
usercode = values(usercode), departmentname1 = values(departmentname1), departmentname2 = values(departmentname2), departmentpath = values(departmentpath)
</insert>
<select id="selectByuserid" resultType="com.blt.other.other_database.model.UserDomain">
SELECT
*
FROM
user
WHERE
userid = #{userid}
userid = #{userid} or useridsso = #{userid}
</select>
<select id="findByUsername" resultType="com.blt.other.other_database.model.UserDomain">
SELECT
*
FROM
user
WHERE
username = #{username} limit 1
</select>
<select id="selectByKey" resultType="com.blt.other.other_database.model.UserDomain">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment