7 changed files with 168 additions and 21 deletions
-
3src/main/java/com/gaotao/config/MybatisPlusConfig.java
-
40src/main/java/com/gaotao/modules/finishedProduct/controller/TransController.java
-
14src/main/java/com/gaotao/modules/finishedProduct/dao/TransdetailsubDao.java
-
12src/main/java/com/gaotao/modules/finishedProduct/service/TransdetailsubService.java
-
13src/main/java/com/gaotao/modules/finishedProduct/service/impl/TransdetailsubServiceImpl.java
-
48src/main/java/com/gaotao/modules/finishedProduct/vo/TransVo.java
-
59src/main/resources/mapper/finishedProduct/TransdetailsubDao.xml
@ -0,0 +1,40 @@ |
|||||
|
package com.gaotao.modules.finishedProduct.controller; |
||||
|
|
||||
|
import com.gaotao.common.utils.PageUtils; |
||||
|
import com.gaotao.common.utils.R; |
||||
|
import com.gaotao.modules.finishedProduct.service.TransdetailsubService; |
||||
|
import com.gaotao.modules.finishedProduct.vo.TransVo; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* @Classname TransController |
||||
|
* @Description TODO |
||||
|
* @Date 2023/3/8 13:16 |
||||
|
* @Created by sxm |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("trans") |
||||
|
public class TransController { |
||||
|
|
||||
|
|
||||
|
@Autowired |
||||
|
private TransdetailsubService transdetailsubService; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @author: sxm |
||||
|
* @description: 获取出入库记录 |
||||
|
* @param [TransVo] |
||||
|
* @return: com.gaotao.common.utils.R |
||||
|
* @date: 2023/3/8 13:19 |
||||
|
*/ |
||||
|
@PostMapping("getTransInfoList") |
||||
|
public R getTransInfoList(@RequestBody TransVo transVo){ |
||||
|
PageUtils page = transdetailsubService.getTransInfoList(transVo); |
||||
|
return R.ok().put("page", page); |
||||
|
} |
||||
|
} |
||||
@ -1,7 +1,19 @@ |
|||||
package com.gaotao.modules.finishedProduct.service; |
package com.gaotao.modules.finishedProduct.service; |
||||
|
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.gaotao.common.utils.PageUtils; |
||||
import com.gaotao.modules.finishedProduct.entity.Transdetailsub; |
import com.gaotao.modules.finishedProduct.entity.Transdetailsub; |
||||
|
import com.gaotao.modules.finishedProduct.vo.TransVo; |
||||
|
|
||||
public interface TransdetailsubService extends IService<Transdetailsub> { |
public interface TransdetailsubService extends IService<Transdetailsub> { |
||||
|
|
||||
|
/** |
||||
|
* @author: sxm |
||||
|
* @description: 获取出入库记录 |
||||
|
* @param [transVo] |
||||
|
* @return: com.gaotao.common.utils.PageUtils |
||||
|
* @date: 2023/3/8 17:05 |
||||
|
*/ |
||||
|
PageUtils getTransInfoList(TransVo transVo); |
||||
|
|
||||
} |
} |
||||
@ -1,11 +1,24 @@ |
|||||
package com.gaotao.modules.finishedProduct.service.impl; |
package com.gaotao.modules.finishedProduct.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import com.gaotao.common.utils.PageUtils; |
||||
import com.gaotao.modules.finishedProduct.dao.TransdetailsubDao; |
import com.gaotao.modules.finishedProduct.dao.TransdetailsubDao; |
||||
import com.gaotao.modules.finishedProduct.entity.Transdetailsub; |
import com.gaotao.modules.finishedProduct.entity.Transdetailsub; |
||||
import com.gaotao.modules.finishedProduct.service.TransdetailsubService; |
import com.gaotao.modules.finishedProduct.service.TransdetailsubService; |
||||
|
import com.gaotao.modules.finishedProduct.vo.TransVo; |
||||
import org.springframework.stereotype.Service; |
import org.springframework.stereotype.Service; |
||||
|
|
||||
@Service |
@Service |
||||
public class TransdetailsubServiceImpl extends ServiceImpl<TransdetailsubDao, Transdetailsub> implements TransdetailsubService { |
public class TransdetailsubServiceImpl extends ServiceImpl<TransdetailsubDao, Transdetailsub> implements TransdetailsubService { |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public PageUtils getTransInfoList(TransVo transVo) { |
||||
|
|
||||
|
IPage<TransVo> transInfoList = this.baseMapper.getTransInfoList( |
||||
|
new Page<Transdetailsub>(transVo.getPage(), transVo.getLimit()), transVo); |
||||
|
return new PageUtils(transInfoList); |
||||
|
} |
||||
} |
} |
||||
@ -0,0 +1,48 @@ |
|||||
|
package com.gaotao.modules.finishedProduct.vo; |
||||
|
|
||||
|
import com.gaotao.common.utils.QueryPage; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @Classname TransVo |
||||
|
* @Description TODO |
||||
|
* @Date 2023/3/8 17:02 |
||||
|
* @Created by sxm |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TransVo extends QueryPage { |
||||
|
|
||||
|
private String startDate; |
||||
|
private String endDate; |
||||
|
private String partno; |
||||
|
private String partdescription; |
||||
|
private String site; |
||||
|
private String transno; |
||||
|
private String transDate; |
||||
|
private String transtypeDb; |
||||
|
private String typedesc; |
||||
|
private String userid; |
||||
|
|
||||
|
private Double itemno; |
||||
|
|
||||
|
private Double seqno; |
||||
|
|
||||
|
private String subno; |
||||
|
private Double subqty; |
||||
|
|
||||
|
private String direction; |
||||
|
|
||||
|
private String orderref1; |
||||
|
|
||||
|
private String orderref2; |
||||
|
|
||||
|
private String orderref3; |
||||
|
|
||||
|
private String orderref4; |
||||
|
|
||||
|
private String orderref5; |
||||
|
|
||||
|
private String remark; |
||||
|
|
||||
|
private String orderref6; |
||||
|
} |
||||
@ -1,25 +1,44 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
<?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"> |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.gaotao.modules.finishedProduct.dao.TransdetailsubDao"> |
<mapper namespace="com.gaotao.modules.finishedProduct.dao.TransdetailsubDao"> |
||||
<resultMap id="BaseResultMap" type="com.gaotao.modules.finishedProduct.entity.Transdetailsub"> |
|
||||
<id column="site" jdbcType="VARCHAR" property="site" /> |
|
||||
<id column="transNo" jdbcType="VARCHAR" property="transno" /> |
|
||||
<id column="itemNo" jdbcType="FLOAT" property="itemno" /> |
|
||||
<id column="SeqNo" jdbcType="FLOAT" property="seqno" /> |
|
||||
<id column="subNo" jdbcType="VARCHAR" property="subno" /> |
|
||||
<result column="subQty" jdbcType="FLOAT" property="subqty" /> |
|
||||
<result column="direction" jdbcType="CHAR" property="direction" /> |
|
||||
<result column="orderRef1" jdbcType="VARCHAR" property="orderref1" /> |
|
||||
<result column="orderRef2" jdbcType="VARCHAR" property="orderref2" /> |
|
||||
<result column="orderRef3" jdbcType="VARCHAR" property="orderref3" /> |
|
||||
<result column="orderRef4" jdbcType="VARCHAR" property="orderref4" /> |
|
||||
<result column="orderRef5" jdbcType="VARCHAR" property="orderref5" /> |
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" /> |
|
||||
<result column="orderRef6" jdbcType="VARCHAR" property="orderref6" /> |
|
||||
</resultMap> |
|
||||
<sql id="Base_Column_List"> |
|
||||
site, transNo, itemNo, SeqNo, subNo, subQty, direction, orderRef1, orderRef2, orderRef3, |
|
||||
orderRef4, orderRef5, remark, orderRef6 |
|
||||
</sql> |
|
||||
|
|
||||
|
|
||||
|
<select id="getTransInfoList" resultType="com.gaotao.modules.finishedProduct.vo.TransVo"> |
||||
|
SELECT |
||||
|
tds.transNo,tds.site,tds.subNo,cr.PartNo,tds.direction,th.TransDate,th.TransType_DB,tn.TypeDesc,th.UserID,th.Remark,p.PartDescription |
||||
|
FROM TransDetailSub tds |
||||
|
LEFT JOIN TransHeader th ON th.site = tds.site AND th.transNo = tds.transNo |
||||
|
LEFT JOIN C_RollInfo cr ON cr.site = tds.site AND tds.subNo = cr.RollNo |
||||
|
LEFT JOIN Part p on p.site = cr.Site AND p.PartNo = cr.PartNo |
||||
|
LEFT JOIN TransNoControl tn on tn.site = th.Site AND tn.TransType = th.TransType_DB |
||||
|
<where> |
||||
|
tds.site = #{query.site} |
||||
|
<if test="query.transno != null and query.transno != ''"> |
||||
|
AND tds.transNo = #{query.transno} |
||||
|
</if> |
||||
|
<if test="query.transtypeDb != null and query.transtypeDb != ''"> |
||||
|
AND th.TransType_DB = #{query.transtypeDb} |
||||
|
</if> |
||||
|
<if test="query.subno != null and query.subno != ''"> |
||||
|
AND p.PartNo = #{query.subno} |
||||
|
</if> |
||||
|
<if test="query.partdescription != null and query.partdescription != ''"> |
||||
|
AND p.PartDescription = #{query.partdescription} |
||||
|
</if> |
||||
|
<if test="query.userid != null and query.userid != ''"> |
||||
|
AND th.UserID = #{query.userid} |
||||
|
</if> |
||||
|
<if test="query.startDate != null and query.startDate != '' "> |
||||
|
AND th.TransDate >= #{query.startDate} |
||||
|
</if> |
||||
|
<if test="query.endDate != null and query.endDate != '' "> |
||||
|
AND th.TransDate <![CDATA[ <= ]]> #{query.endDate} |
||||
|
</if> |
||||
|
|
||||
|
</where> |
||||
|
|
||||
|
order by th.TransDate |
||||
|
|
||||
|
</select> |
||||
|
|
||||
</mapper> |
</mapper> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue