|
@@ -233,8 +233,8 @@ func YmyFeedtempletPush(pastureId, farmId, date string) error {
|
|
|
dataList, err := tx.SQL(`SELECT
|
|
|
ft.tcode AS recipeId,
|
|
|
ft.TNAME AS recipeName,
|
|
|
- f.feedcode AS ingId,
|
|
|
- f.feedcode AS feedCode,
|
|
|
+ ifnull(f.feedcode,f.id) AS ingId,
|
|
|
+ '' AS feedCode,
|
|
|
ifnull(f.udname,f.fname) AS ingName,
|
|
|
round( fn.dry * ftd.FWEIGHT, 2 ) AS dmQty,
|
|
|
ftd.FWEIGHT AS afQty,
|
|
@@ -286,7 +286,7 @@ func YmyUtirPush(pastureId, farmId, date string) error {
|
|
|
now = time.Now().AddDate(0, 0, -1).Format("2006-01-02")
|
|
|
}
|
|
|
|
|
|
- dataList, err := tx.SQL(`select MD5(CONCAT(d.pid, d.mydate)) loadId , date_format(d1.date,'%Y-%m-%d') dropDate,date_format(d1.date,'%Y-%m-%d') loadDate,d.times loadShift,d.id tmrNo,ft.tcode recipeId,ft.ccname recipeName,'' ingId,'' feedCode ,ifnull(f.fname,ftd.fname) ingName,
|
|
|
+ dataList, err := tx.SQL(`select MD5(CONCAT(d.pid, d.mydate)) loadId , date_format(d1.date,'%Y-%m-%d') dropDate,date_format(d1.date,'%Y-%m-%d') loadDate,d.times loadShift,d.id tmrNo,ft.tcode recipeId,ft.ccname recipeName,ifnull(f.feedcode,d1.fid) ingId,'' feedCode ,ifnull(f.fname,ftd.fname) ingName,
|
|
|
ifnull(ifnull(fc.fcname,(select fcname from feedclass fc1 join feed f1 on f1.fclassid = fc1.id where f1.id =ftd.fid )),'饲料') ingType,
|
|
|
ifnull(f.dry * d1.actualweightminus,0) dmPct,d1.sort mixNo,ifnull(d1.feedallowratio,0) allowableError , if(f.fname is not null, ifnull(d1.lweight,''), ifnull(ftd.fweight / (select sum(fweight) from ftdetaildate where date = d1.date and ftid = d1.fid ) * d1.lweight,"") ) expWeight,
|
|
|
|