废钢采购销售统计明细表(按磅单)

product
bawei 2 years ago
parent 81315d4cb7
commit 4b83524180

@ -484,7 +484,19 @@ public class PoundlistController {
List list=poundlistService.qureylist(poundlistSEntity); List list=poundlistService.qureylist(poundlistSEntity);
return ActionResult.success(list); return ActionResult.success(list);
} }
/**
*
*
*
* @param
* @return
*/
@ApiOperation("废钢采购销售统计明细表(按磅单)")
@PostMapping("/purchasesalesPriceList")
public ActionResult purchasesalesPriceList(@RequestBody PoundlistTwoEntity poundlistTwoEntity){
List list=poundlistService.purchasesalesPricelist(poundlistTwoEntity);
return ActionResult.success(list);
}

@ -0,0 +1,59 @@
package jnpf.poundlist.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.math.BigDecimal;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-21
*/
@Data
@TableName("jg_poundlist")
public class PoundlistTwoEntity {
@TableId("ID")
private String id;
@TableField("CREATOR_TIME")
private String creatorTime;
@TableField("DELETE_TIME")
private String deleteTime;
@TableField(exist = false)
private String supplierName;
@TableField(exist = false)
private String itemName;
@TableField(exist = false)
private String unit;
@TableField(exist = false)
private String weight;
@TableField(exist = false)
private String purchasePrice;
@TableField(exist = false)
private String supplierNm;
@TableField(exist = false)
private String salesPrice;
@TableField(exist = false)
private String startTime;
@TableField(exist = false)
private String endTime;
}

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import jnpf.poundlist.entity.PoundlistEntity; import jnpf.poundlist.entity.PoundlistEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.poundlist.entity.PoundlistSEntity; import jnpf.poundlist.entity.PoundlistSEntity;
import jnpf.poundlist.entity.PoundlistTwoEntity;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -24,5 +25,5 @@ public interface PoundlistMapper extends BaseMapper<PoundlistEntity> {
//销售毛利表 //销售毛利表
List<PoundlistSEntity> qureylist(PoundlistSEntity poundlistSEntity); List<PoundlistSEntity> qureylist(PoundlistSEntity poundlistSEntity);
//废钢采购销售统计明细表(按磅单) //废钢采购销售统计明细表(按磅单)
List<PoundlistSEntity> qureylist2(PoundlistSEntity poundlistSEntity); List<PoundlistTwoEntity> qureylist2(PoundlistTwoEntity poundlistTwoEntity);
} }

@ -3,6 +3,7 @@ package jnpf.poundlist.service;
import jnpf.poundlist.entity.PoundlistEntity; import jnpf.poundlist.entity.PoundlistEntity;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.poundlist.entity.PoundlistSEntity; import jnpf.poundlist.entity.PoundlistSEntity;
import jnpf.poundlist.entity.PoundlistTwoEntity;
import jnpf.poundlist.model.poundlist.PoundlistPagination; import jnpf.poundlist.model.poundlist.PoundlistPagination;
import java.util.*; import java.util.*;
/** /**
@ -30,6 +31,8 @@ public interface PoundlistService extends IService<PoundlistEntity> {
boolean update( String id, PoundlistEntity entity); boolean update( String id, PoundlistEntity entity);
List<PoundlistSEntity> qureylist(PoundlistSEntity poundlistSEntity); List<PoundlistSEntity> qureylist(PoundlistSEntity poundlistSEntity);
//废钢采购销售统计明细表(按磅单)
List<PoundlistTwoEntity> purchasesalesPricelist(PoundlistTwoEntity poundlistTwoEntity);
// 子表方法 // 子表方法

@ -245,6 +245,12 @@ public class PoundlistServiceImpl extends ServiceImpl<PoundlistMapper, Poundlist
return list; return list;
} }
@Override
public List<PoundlistTwoEntity> purchasesalesPricelist(PoundlistTwoEntity poundlistTwoEntity) {
List<PoundlistTwoEntity> list= poundlistMapper.qureylist2(poundlistTwoEntity);
return list;
}
@Override @Override
public void delete(PoundlistEntity entity){ public void delete(PoundlistEntity entity){
if(entity!=null){ if(entity!=null){

@ -31,6 +31,28 @@ WHERE
OR OR
a.department_id =#{departmentIdS} a.department_id =#{departmentIdS}
</select>
<select id="qureylist2" resultType="jnpf.poundlist.entity.PoundlistTwoEntity">
SELECT
a.id,
b.supplier_name AS supplierName,
item_name AS itemName,
unit,
( CASE unit WHEN 0 THEN 1 WHEN 1 THEN unit/1000 END ) * settlement AS weight,
purchase_price * settlement AS purchasePrice ,
c.supplier_nm AS supplierNm ,
sales_price * settlement AS salesPrice
FROM
jg_poundlist a
LEFT JOIN jg_supplier b ON a.supplier_id=b.id
LEFT JOIN jg_customer c ON a.customer_id=c.id
LEFT JOIN jg_material d ON a.material_id=d.id
WHERE
a.creator_time BETWEEN #{startTime} and #{endTime}
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save